Samuel Jacob's Weblog

Just another technical blog

USB image creation using dd command

without comments

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

How to find where my usb drive is attached?

Attach USB and then issue the following command and then look for ‘/dev/sd??’
dmesg | less

How to create a USB drive clone?

sudo dd if=/dev/xxx of=clone.img
The output image will be in clone.img.
If you want to restore to the original disk or another USB drive then use
sudo dd of=/dev/xxx if=clone.img

How long will it take for a X GB 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

iostat will give you the transfer rate of your devices

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`

Written by samueldotj

February 9th, 2011 at 3:22 am

Posted in C,gcc,Tools