dd command

My machine has 2 hard disks. I have installed Solaris 10 in disk0 of my machine. I used dd command to copy from one disk to the other disk. The disk capacity is 73GB.

I gave the following command:
dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t2d0s2

I waited for four days but the process did not terminate. How long will it take to copy one disk to the other?

Thanks,
Savitha

What type of machine is this? Whatr type of disks (IDE, SCSI, fiber channel, etc.)? How big is the disk? Is the OS on c1t0d0 on other slices, or is there heavy O/O on that disk?

Timely question! I started a 73 GB dd disk copy a few hours ago. Unfortunately, both disks are on the same scsi controller. This is on an HP rp3440. I have glance running watching the dd process. glance can continuously update the display just like top does. By watching the file offsets I can see how fast the dd is progressing. I am getting almost 5GB/hour. And I thought this was slow. 4 days! whoa....

My command line:

dd if=/dev/dsk/source-disk bs=10485760 of=/dev/dsk/destination-disk

Your command line will behave like either:

dd if=/dev/dsk/source-disk bs=512 of=/dev/dsk/destination-disk
dd if=/dev/dsk/source-disk ibs=512 obs=512 of=/dev/dsk/destination-disk

You need to crank that block size up.

I've always wondered what block size I should be using for a dd copy. Does it differ by hardware (for example a DVD drive vs. a Hard drive)? How does one know what block size to use?

Some day I will benchmark a few runs of dd and find the optimal setting, if there is one. I have only dd'ed magnetic disks. Never dd'ed a cd-rom, let alone a dvd. So I'll stay with what I know. Use the rdsk style device, not the dsk so the data goes to straight your data segment (not via the buffer cache). The rdsk driver has to read whole sectors. If you ask for a piece of a sector, it may not work. Or it may read a sector and discard what you don't want. I stay with a multiple of 1024. Bigger is better than tiny. But after a point, the advantage starts to taper off. 1 MB is the smallest size I would consider trying. I will want to mentally estimate how much is left, etc...so no screwball sizes. I wind up with N * (1 MB) where N is some small integer. 10 MB seems like a nice round number. We have one bad spot on the disk. I expect dd to fail when it gets there. I will restart it on the next 10 MB chunk. So I have doomed myself to having a 10 MB hole in my disk. That is pretty much my thought process as I picked my blocksize.

It would be a disaster to pick a buffer size so large that box starts to page. I have plenty of memory on this box, so no problem there.

I dd from CD-ROM and DVD quite often to make iso images for mounting under VMWare ESX server. I always use a bs=512 in the dd command when creating the ISOs. I've never timed it, but also never been disappointed with performance - most data I've ever dd'd from optical media is around 1.4Gb.

Cheers
ZB

The disks are under a SCSI controller. Solaris 8 has been installed in c1t0d0. 4 days is indeed long time.

Regards,
Savitha

OK, so I have a window with glance running to watch the internal operations of my dd command. The top few lines of glance are activity bars showing overall system utilization. For hours, disk usage was at 100%. Then I noticed that it dropped to 0. No disk utilization at all. Did my dd finish? Nope. It is still running. Both of my file pointers froze at exactly 34359738368. I allowed this situation to persist for a hour or so, mostly because I was busy with something else. Then I killed the dd command. I am certain it would have "ran" for another 4 days if I have let it. Or another 4 years. glance said that dd was in I/O wait and that (to me) points the finger towards the driver. If a gigabyte is 2^30, then 34359738368 is exactly 32 GB. That is a larger number than will fit into 32 bits. So the kernel, the driver, and dd are all in 64 bit mode. But apparently, the driver bumped into some other limit. :mad:

I used ufsdump instead of dd command. It worked

Regards,
Savitha

You can also try this:

cat /dev/rdsk/c1t0d0s2  > /dev/rdsk/c1t2d0s2