Search This Blog

Wednesday, February 09, 2011

USB image creation using dd command

Wrote this post while waiting for a "dd" command to finish USB image creation. So this post is mainly for dd tips.

1) How to create a USB drive clone?
sudo dd of=/dev/xxx if=clone.img
The output image will be in clone.img. If you want to restore to the original disk or another usb drive use sudo dd if=/dev/xxx of=clone.img

2) How to find where my usb drive is attached?
dmesg | less
This will tell which device name is attached to the usb drive.

3) How long will it take for a 4GB drive?
Depends on your usb drive transfer rate.
But also depends on the buffer size used by dd, I use
sudo dd of=/dev/xxx if=clone.img bs=10M
sudo dd if=/dev/xxx of=clone.img bs=10M

iostat will give you the transfer rate of your devices

4) Dont know whether dd is dead or not?
If you send USR1 signal to dd it will print the status.
sudo kill -USR1 `pidof dd`
If you want auto update every 10 sec, try
watch -n 10 sudo kill -USR1 `pidof dd`