Depends a lot on how you want to resize it and how your partitions are organized. Growing a partition (moving its end further down the disk) is easy, while shrinking a filesystem, especially by moving its partition start closer to its end, is virtually impossible if you want to do it in-place. You'd have to:
- backup the partition to be shrunk to another drive (or - if you are brave enough - at least to a partition that you are not going to touch at all)
- run partitioning sw (fdisk/gdisk/parted/...):
- remove partition that follows the one you need to grow
- move end of the previous partition - either your program can do that in one step, or you have to note it's start position, delete it and recreate it with exactly the same start. Also note, that some programs might have the tendency to format the newly created partition, in which case you'd end up doing fresh reinstall.
- create the next partition in the smaller space that is left
- grow the filesystem on the grown partition.
- create a new filesystem on the new smaller partition and copy your data from the backup.
That said, I would propose something else (apart from a reinstall, which doesn't have to be that messy, provided you save your system configuration properly):
- check whether the space problem isn't caused by overflowing
/tmp or /var directories and possibly do some cleanup;
- check whether you don't have some dead packages, that you no longer use - those would be just possible security risks;
- after that, check whether there are some substantial parts of the rootfs that could be moved to a separate partition - likely candidates are:
/tmp, /var, /opt, /usr/local. If that turns out to be the case, create a separate filesystem, create a directory in /, mount the filesystem there, move there the subdirectories in question, and bind-mount them to their previous locations (e.g. mount --bind /new_partition/var /var). Remember to add all the needed mounts to /etc/fstab. If you are moving only one subtree, you can plainly mount it to it's original place and not mess with bind-mounting.
edit:
You can also move the contents of the root partition to another bigger one - the only things that should be necessary to change are references to the root partition (as a device) in:
/etc/fstab (or any other files used for mounting filesystems)
bootloader configuration
a) what partition to load the kernel and initrd from (unless you have a separate /boot filesystem that you are not going to touch)
b) the root= kernel option which tells kerenl wha to mount as / (not sure whether that would be the case with initrd, but it's going to have to be changed somewhere).
All of these operations should not be done from the system you are intending to change (especially the move of /tmp and/or /var to a different filesystem - daemons may keep their files there and it could damage the running system) - a live CD or another minimal installation should do the trick.
man gpartedbut that doesn't beat a good tutorial. – trusktr Nov 3 '12 at 22:18