Moving a Linux installation to a bigger drive

7 02 2008

I recently wanted to move my Gentoo installation from one notebook HDD to another, a bigger one. Moving the data over the network was fairly easy: Boot up two laptops with live CDs, in my case I happened to have two Ubuntu 7.10 CDs flying around, then start up netcat as root on one of them and using it on the other to copy the data:
nc -l -p 3333 > /dev/hdX on the receiving part and dd if=/dev/hdX | nc -q1 <target IP> 3333 on the sending one. You can use any other port, 3333 was the example that I used, and remember to replace hdX with your actual device. Alternatively, and a lot easier, is to use a mobile HD case to connect one of the drives to an USB port and then do the same as above without using netcat. If you do it this way, with dd, then you will retain everything, including the MBR so even your boot manager will be preserved. The next thing is to resize (expand) your data partition so that it can grow to make use of the additional storage space on your drive.

At first I tried using Partition Magic and similar tools from Acronis, which were always helping me out during my Windows days. Granted, the software was already a little dated, but the ext3 partitions wouldn’t have been any trouble for them. But nada, Partition Magic refused to do anything as it reported that the disk geometry of the target drive didn’t match the physical disk geometry present, which could lead to data loss and corruption. I was afraid that this was a real problem that was induced through my transfer solution, but it actually reported the same on the original drive as well. I popped in the Ubuntu live CDs again and was delighted to see that the Partition Manager parted had no trouble to fulfill the task, and with the graphical version GParted which can be accessed through System > Administration > Partition Editor, you have a nice GUI which is reminiscent of Partition Magic itself. The Qt version QtParted strangely wasn’t able to do this task, so give the Gnome version a try if you run into trouble.
GParted in action

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: