How can I resize an ext root partition at runtime?
You can use fdisk to delete the root partion and then recreate it at the same starting block. fdisk will write out the change, but it won't take effect till after a reboot. after the reboot you can use the resize2fs program to send the disk to fill the partion.
Example:
$ sudo fdisk /dev/sda
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 9437183 4717568 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): p
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
Using default value 10485759
Command (m for help): p
Device Boot Start End Blocks Id System /dev/sda1 2048 10485759 5241856 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.
Again, it is critical that the new partition starts at the same block as the old. The Id should also match (83 for Linux systems). Be prepared to lose all your data at the slightest typo.
By now it should be apparent why people recommend using a live CD. ;-)
However, once the partition is resized (and the system rebooted, if necessary), it's a simple matter of running resize2fs on the file system, and you can do this even when it's mounted as the root partition.
Example:
$ sudo resize2fs /dev/sda1