-   Programming (
-   -   Hard drive cloning (

sabeel_ansari 02-14-2006 02:20 PM

Hard drive cloning

I want to write a program which will create an exact copy of my hard drive onto a second external hard drive (thru the USB port). I have some basic idea on how to do this, but am not very clear. I am trying to find some material on this but cant seem to find much. If you have any idea on how to do this, can you give me some tips or point to some pages where I can get this info.

thanks in advance.

puffinman 02-14-2006 02:39 PM

The utility dd can do this pretty easily. For instance, to clone your main drive (say /dev/hda) to a usb connected mass storage device (say /dev/sda1) you would do:


dd if=/dev/hda of=/dev/sda1 bs=1M
The bs argument is optional but using a bigger one should speed things up. You would of course need root access in order to copy directly from a device like this. Also make sure you have everything backed up somewhere in case something goes wrong (like accidentally switching the if and of arguments). :cry:

schneidz 02-14-2006 02:40 PM

i backup my thumbdrive by doing:

cat /dev/sda1 > usb.bak
and re-flash it by:

cat usb.bak > /dev/sda1
let me know if this gets you started.


All times are GMT -5. The time now is 03:19 PM.