Repartitioning

On Pinto, the ThinkPad T60, I needed to make room to try openSUSE (hibernation supposedly works better than on Fedora). The first step is to start up QTParted. On selecting the disk, QTParted reports Error: File system has an incompatible feature enabled. Resize and move commands were disabled for the ext3 partitions.

I found instructions that supposedly fix this:
umount /dev/xxx
tune2fs -O^dir_index /dev/xxx
parted
tune2fs -O dir_index /dev/xxx

But they didn’t.

From Bugzilla:

Currently the _only_ tool that can resize ext3 filesystems is resize2fs available in e2fsprogs. While annoying, you can use resize2fs to resize the filesystem and then use fdisk or parted to resize the partition boundary to match the new filesystem size. With parted 2.0, we’ll be able to do this in one step.

resize2fs -p /dev/sda6 7500M (resize2fs won’t take fractional units like 7.5G) will work, then you have to delete and recreating the partition to the correct size. This got a little tedious, so I started my GParted Live CD version 0.2.5, though the latest is 0.3.3. It was able to resize the partitions. I shrunk my two 14 GB Fedora Core 5 and 6 partitions to 10 GB each and consolidated some unused space to make room for a new 10 GB partition. Some important tips:

  • You can’t move the start of an ext filesystem partition, but you can shrink and grow it. Shrinking a parition as small as it can go can give you enough room to copy and paste it to unallocated space, then delete the original. Using this “Tower of Hanoi” technique, you can effectively move partitions if you have enough space.
  • Creating and deleting a partition changes its device name, e.g., /dev/sda6 becomes /dev/sda7. If you aren’t using disk labels in GRUB (/boot/grub/grub.conf), your system won’t boot. Either use disk labels (see the tune2fs man page for the -L option) or update your grub.conf after you move the partitions.