Last weekend I upgraded my T40 from the 30 Gb drive it came with to an 80 Gb drive, as I was running out of space and needed to run WinXP under VMWare on my Fedora Core 6 installation. I used partimage to make snapshots of the existing NTFS partition, the WinXP the machine came with, and three ext3 partitions, the FC6 and an Ubuntu boot and root partitions.
I have to grudgingly admit the NTFS was the easiest to move and resize, using nothing but Linux tools. How weird is that? Using Knoppix to capture and rewrite the master boot record, WinXP booted, complained about the size, run CHDSK, fixed itself, and rebooted. Ext3 is a little tougher: it’s a simple but obscure set of commands to drop the journal from the filesystem, turning it into an ext2 system, resizing, and then applying a new journal to the result.
A little fiddling with the grub.conf added the proper menu items, pointing to the new partitions (several had to get renamed to support more partitions, extended partitions, and all that), and Fedora Core 6 came right up. I wasn’t so lucky with Ubuntu.
Ubuntu threw a kernel panic when starting up, and it took a bit of detective work to figure out that the mkinitramfs-tools were the problem. These tools figure out where the swap partition is, and determine if there’s an image there to restore from. The problem was that the old swap partition (/dev/hda4) was now the container holding all of the extended paritions and would throw an error when there was an attempt to read the partition. In the file /etc/mkinitramfs/initramfs.conf or the subsidiary file /etc/mkinitramfs/conf.d/restore.conf, you’ll find a line RESTORE=/dev/xxxx. Change that to the location of your new swap file and presto! You’re back in business!