Thursday, January 29, 2009

On Cloning a Hard-Drive: The Solution

Thanks to Renaud and Jim for their input.

Jim - At some point I'll adopt a "constant backup" solution (using an online service or local backup server), but for the time being, I think I found a winner.

So I want to clone the hard-drive (source) that I've spent the past few days configuring onto a second drive (target) so that I can swap the two drives without worrying about reinstalling applications, reconfiguring email accounts, etc. The idea is that I will clone the source drive onto the target drive at least once a week so that I can stay up-to-date with Ubuntu patches and packages. And if something goes wrong with the source drive, I can plug the target drive in and I'll be ready to go. I'm also planning to make and copy an .iso of the source drive over to another external hard-drive just in case things don't always work with the disk-to-disk cloning.

In order to solve this problem, I used CloneZilla 1.2.1-23 to clone my current Ubuntu setup (with all applications, emails, and other data) over to a second drive (target).

First of all, the size of the target drive matters -- it cannot be smaller than the source drive. That's pretty obvious, but I was hoping there would be some way for CloneZilla to see that only a portion of the source drive was being used and copy just that data over to the target drive, resizing partitions as needed.

No big deal. I just had to play around with the partitions on both drives to make sure that the source drive was smaller than the target drive. There are plenty of tools that allow you to edit the partitions on any of your attached hard disks, but it's not very safe to edit the partition used to boot into Ubuntu since the source drive is mounted.

Therefore, I created a new bootable CD off the latest System Rescue CD ISO ( in order to run gparted from outside Ubuntu. This CD is a life saver and has a lot of great tools. Resizing the partitions took about 10 minutes and once that was done, the CloneZilla part was a breeze.

Next time I run through the CloneZilla process I'll write the exact instructions down. For now, I'll just say that I walked through the CloneZilla wizard and gave logical answers to questions, answered "yes" to all of the paranoid "are you sure?" questions, and after about 20 minutes, the target drive was cloned and bootable (CloneZilla also installs GRUB on the new drive).

No comments: