Make ‘dd’ talk

harddisk.eakokp9bh40kww4w8kcs4ggko.17ldmg3f9ou8088wk04c40sgo.thI’ve always felt frustrated when using the ‘dd’ program to clone harddisks. It does it’s job beautifully and I’ve come to use it somewhat regularly at work lately, but it’s a pain to have to sit around waiting for it to finish. You simply have no clue how long it’s going to take.

If you’ve ever used ‘dd’ before, you properly know that it produces absolutely no output at all while running. Just like the ‘mv’ and ‘cp’ programs.

To my relief, I finally found a solution to make ‘dd’ display some active output. It requires a second terminal window, though.

After starting a new ‘dd’ job, like this one:

dd if=/dev/hda of=/dev/hdb bs=1M

You can then (in a different terminal window) execute the following command to make ‘dd’ give you a status report:

pkill -USR1 ^dd$

Now, have a look back in the original terminal window where ‘dd’ is currently working. You should now (within a few seconds) see some output looking like this.

Huzzah!

Alternatively you could use the program ‘watch’ to send the command regularly, so you receive the output automatically once in a while. Use ‘watch’ like this: (again, in a different terminal window)

watch -n5 -- pkill -USR1 ^dd$

This will generate a status report every 5 seconds in the original terminal window.

Get printer-friendly version

Leave a reply