The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference DSK RDSK guillaume35 Filesystems, Disks and Memory 7 05-13-2009 07:05 AM
mounting USB floppy drive /Flash drive in OSR 6.0 sureshdrajan SCO 5 02-29-2008 12:36 PM
Map Drive From Windows To Apache Shared Drive? gseyforth UNIX for Dummies Questions & Answers 0 02-23-2008 07:56 PM
Create an Ignite image on tape from Online IgniteUX image Andrek UNIX for Advanced & Expert Users 3 02-28-2007 07:14 PM
Image My Drive ErikTheHAck HP-UX 0 06-06-2006 02:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-23-2006
aicjofs aicjofs is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 2
rdsk vs dsk for image drive

what is the difference between using the following commands to image a drive besides one taking 9hours and the other 15min?

dd if=/dev/dsk/c0t5d0 of=/dev/dsk/c0t4d0 bs=1024k

dd if=/dev/rdsk/c0t5d0 of=/dev/rdsk/c0t4d0 bs=1024k

Is there reliability issues in one over the other. I have read some things about direct driver communication, OS use, etc for the difference but I just can't seem to wrap my brain around it.
  #2 (permalink)  
Old 03-23-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
character driver (rdsk)
The driver has read and write entry points. The read and write system calls pass this off to the driver. The driver decides if the operation succeeds or not. If it fails, the driver can set any errno value it wants. There are standards, but some driver writers do not follow them. There are rules to follow and they can vary from driver to driver. Typically you must start a read or write on a disk sector boundary. And you must write full sectors. If you try to write a partial sector, and the driver allows it, you will probably garble the rest of the sector. Data moves directly to/from the disk to/from your program. There is no synchronization with data in the buffer cache.

block driver (dsk)
The driver has no read or write entry points. You cannot talk to the driver in a direct manner. The kernel must prepare a buffer header to pass to the driver's strategy entry point. read() and write() should strongly follow the man page. No sector boundary rules. You can write a single byte and it should work. Data must flow to/from the buffer cache and then to/from your program; and thus is in sync with any recent changes.

(Note that the "in sync" implies operations to the same device. If you mount a slice of a disk, then dd the whole disk via another special file, it won't be in sync.)

I would always use rdsk to avoid copying the data around in core. Your 9 hours vs 15 minutes is very extreme. You don't give any particulars of your situation. But it does not take 8 hours and 45 minutes to do the in-core copying of data that can be read in 15 minutes. I don't enough info to guess what happened.
  #3 (permalink)  
Old 03-23-2006
aicjofs aicjofs is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 2
Thanks for responding!

The system is a HP B180L workstation 180mhz CPU. I was just attempting to image the 9.1GB SCSI drive(main drive on id 6) to a 9.2GB SCSI(backup drive on id 5).

Basically I am doing simple boot. Logging in as root, and running the commands as I stated above(except obviously SCSI 6 not 5).

"dsk" takes 9 hours, and "rdsk" about 15min. I am concerned that the image is proper. Usually longer is better(more exacting but 9hrs is excessive)

I'll be honest. I am a *nix noob an appreciate the help.

Also the dev's for SCSI id #4(with ioscan -funC disk) has /dev/rdsk/c201d4s0 and the /dev/rdsk/c0t6d0, also 2 more dev's with "dsk". What is the c201d4s0? SCSI id #6 doesn't have these.

I know these are simple and incredibly stupid questions but I am just starting out in this Unix world.

Thanks for the help!
  #4 (permalink)  
Old 03-23-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Just because a process takes longer does not make it better. You can always find a longer way to accomplish a task. The size of your memory and really, the size of your buffer cache must be the problem. But you should use the raw device anyway.

That c201d4s0 does not look right to me either. But there are problems with the other devices names too. Something like /dev/rdsk/c0t6d0 is supposed to mean:

c0 (controller 0) the first scsi card configured in the system. It will have a chain of scsi devices and each device will have a scsi id. By convention, the controller itself will have an id of 7.

t6 (target 6) this is a device in the scsi chain. It will have a scsi id of 6. You seem to be saying that scsi id 4 got t6. That is a little odd.

d0 (disk 0) With ordinary disk mechs, d0 is all there ever is. But imagine 2 or 3 disks all sharing one scsi address. This is how you would tell them apart. This does get used in disk arrays.

All of this is a naming convention. You can call the disk /home/fred/stupid and it would still work. But don't do that.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0