Resizing Filesystems
I ran out of space on the backup drive today (must replace that 40G with a newer, bigger disk!) and decided I wanted to consolidate the last two partitions into one. The filesystem (ext2) was on sda3, and sda4 was blank.Supposedly parted and qtparted can resize a filesystem, but when I select the relevant partition in qtparted (delete sda4, then select sda3) and tell it to resize, it gives an error message:
No Implementation: This ext2 filesystem has a rather strange layout! Parted can't resize this (yet).
I ended up using cfdisk to resize the partition, then resize2fs to grow the filesystem. Since there doesn't seem to be a howto on resizing filesystems, here are the steps:
- cfdisk /dev/sda
- Select hda4 and delete it.
- Select hda3 and delete it. (Partitioning programs like fdisk and cfdisk don't have "resize", they only have delete and recreate.)
- Create a new partition, using all the available space.
- Write and quit.
- resize2fs -p /dev/sda3 (there's also a resize_reiserfs). This required that I run fsck first (even though the filesystem had been unmounted cleanly). It's possible that that was why qtparted failed to resize, but if so, it should have said so.
[ 17:58 Dec 08, 2004 More linux | permalink to this entry | ]