Disclaimer: Following my instructions will destroy all your data.

Figure out where you should be
If you are trying to resize a partition that is easily unmounted (say /mnt/something etc) then you are good to go. Unmount it. Otherwise, you will want to boot from a live cd with the tool resize2fs.

Figure out how big it should be
Run the command: df -h

Figure out what partitions you actually have
Run the command: fdisk -l

If you don’t see anything, its because you need to be root.

Turn off the journal (this step is ext3 only):
Run the command: tune2fs -O ^has_journal /dev/hda1
Replace hda1 with the device name of the partition we are resizing.

Check the filesystem:
Run the command: e2fsck -f /dev/hda1

Actually resize it:
Run the command: resize2fs /dev/hda1 2G

2G is the desired size. This could also be 2000M, 2000000K etc if you need more accuracy.

Resize the partition
Run the command: fdisk /dev/hda

First, delete the old partition, noting where it starts and stops. resize2fs will tell you how big the new size is, and multiply that times 4 to get where the partition should end (start position + (resize2fs output * 4) = end position). Also you may need to make it a touch bigger, as if the partition is too small data will be lost! Make sure to write partition data, then reboot.

Turn the journal back on
Run the command: tune2fs -j /dev/sda1

Reboot

Related posts:

  1. Resize Windows XP Partition in VMWARE
  2. Encrypted Swap
  3. Looking for someone to give me a hand
  4. Finding out how long programs have been running on Linux