PartImage for Rearranging Hard Disk Partition Scheme
Sunday, October 22nd, 2006Some weeks back I got into the situation where I needed to rearrange the hard disk space on my computer and was thinking “there MUST be a tool out there that can help me to achieve this.” So I jumped on the internet and start browsing around. I came across a number of tools and also found a website http://www.thefreecountry.com that can probably be interesting to anybody who is looking for a lot of software links. (mostly free) The main thing I was looking for was a tool that would enable me to not only copy the contents of my hard disk but also maintain the correct permission and ownership settings. Basically I was looking for disk cloning software.
The tool that I finally landed upon that I thought fitted with my objectives was PartImage. I visited the website (http://www.partimage.org/) and read through the documentation to see its capabilities. I found out that to make it more useful, it comes bundled into a collection of tools on a live CD called SystemRescueCD (http://www.sysresccd.org/). Ordinarily I would have used the tools within my already running linux system but I needed something that could actually shift around partitions so that I could get some disk space at the beginning of the hard disk.
I burnt the SysRescueCD and booted my computer. It booted to the command line and I started PartImage. It is at this point that I got some doubts in my head. What if it did not work. With this scare, I immediately backed up the entire contents of my /home and /srv (+ some other files that I felt I should not lose) partitions onto an external hard disk. (this took a couple of hours of moving away and doing some other things by the way)
When all was done, I started PartImage again and the process was as simple as going through two screens where I had to fill in the location that I wanted the images backed up to, the image names and to specify whether I wanted the tool to break up the image into a number of smaller files. (this feature enables backing up the image on multiple CDs for example.) It cloned the disk at a rate of 1.2xGB per minute. I was very impressed with this. I did all the four partitions that I had and then (not very relaxed though) formatted the partitions and reset my entire disk partitioning scheme. My unrest was later justified when I found out that I had wiped out my LFS project partition. This was not entirely a disaster but did leave me with a lot of work to do.
With the disk re-partitioned, I thought “here goes nothing” as I performed the restoration. The restoration complete, I had to reinstall GRUB boot loader. Once that was done the whole system worked like NOTHING had changed. It was sweet music hearing the KDE logon sound.
There were a few catches though;
- I had to change the mount points definitions in /etc/fstab file to make sure they matched with the new partitioned scheme.
- On restore, I had formatted the home partition as ext3 filesystem. It was previously reiserFS. PartImage restored the partition as reiserFS. I guess this makes sense considering some filesystems have special encryption data / schemes that would be lost if restoration was independent of filesystem.
- There was a warning in the documentation about the partitions having to be a similar (or was it same) size as the one that was imaged. Too small I can understand but if a partition is larger it should not be a problem. I did not experiment with this too closely so no concrete answers there.
That was my little experience with PartImage. It turned out to be a very useful tool for me.