Printing dd status
I recently used dd to zero out some hard drives on my Fedora Core workstation, and found that this operation takes a good deal of time (even when large blocksizes are used, it still takes a while). The dd utility doesn’t report status information by default, but when fed a SIGUSR1 signal it will dump the status of the current operation:
$ dd if=/dev/zero of=/dev/hda1 bs=512 &
$ kill -SIGUSR1 1749
1038465+0 records in
1038465+0 records out
531694080 bytes (532 MB) copied, 11.6338 seconds, 45.7 MB/s
It still amazes me how much stuff I have left to learn about the utilities I use daily.








boycat on July 26th, 2006
short version: good for linux, don’t try on OSX. :)
long version:
i found this entry looking for a way to find out how long this dd i am currently running was going to take. my command ‘dd bs=512 if=/dev/disk3 of=/dev/disk2 conv=noerror,sync’ was meant to clone the failing drive in my powerbook (attached in firewire target mode (disk3) to my workstation powerbook) to another attached drive of identical geometry also on firewire (disk2).
i played with lsof and a few other commands in an attempt to derive total capacity or blocks or something in hex and compare them to the number of instruction calls dd has performed… and was getting WAY in depth on this. I decided there should be a simpler way … I should have known – BSD != linux. ;)
kill -SIGUSR1 will cause abrupt termination of dd with the result “User defined signal 1″.
WHoops! Now I gotta start over.
Good learning experience though.
I know there’s stuff like “Carbon Copy Clone” for OSX but i refuse to believe a good dessert can’t be made from a recipe of dd, disklabel, diskutil, and a sprinkle of some other stuff without using some GUI that removes you from what’s really happening underneath.
but.. just in case anyone else finds this, is using OSX, and wants to try it – beware, you might be starting your dd over again. in my case, i was 2 hrs into it. :) doh!
-jre