From LQWiki
Contents |
Info
This is a practical example of what I did to clone my disk to be up and running as soon as I get the new laptop.
Clone the disk
First of all I booted from the laptop on a live CD (Gentoo live cd for example), started ssh and gave root a password.
Then from the laptop, I ran the following command
# dd if=/dev/sda bs=512 | ssh sys@192.168.1.100 "dd of=/raid0/data/eco_Desktop/sys_rsync/hyperion_laptop_sda.img"
This command takes an exact copy of my 100G disk and sends it to my NAS via ssh and saves it as an image on the NAS.
This took approximately 11 hours to complete so before you run the command I'd use the screen command in case you need to close the terminal.
Check the image
There are many ways to check the state of the image. The following is how I chose to do it.
- Install a kubuntu vm in VirtualBox.
- Add an extra 'vm disk' (sdb) of 110G to contain the image.
- Make the CDRom point to our image.
- Boot into the vm
Now I can copy my image back to the secondary device like this:
# dd if=/dev/cdrom of=/dev/sdb bs=512
The i/o might be high so it could take a while. Took me ~17 hours.
- Shutdown the vm
- swap the boot disk order and make sdb primary master.
- Boot the system and see if it works.
The system booted and asked for the password to my encrypted filesystems. It then fully booted regardless of hardware change, etc. I checked the files and found no corruption.
This proves that my image is good and that linux rulz!

This page is available under a