How to shrink the root volume on a Scientific Linux (RHEL6) installation:
- Make backups first. This could trash your Linux installation if something goes wrong.
- Get the appropriate rescue disk (boot.iso) from http://www.scientificlinux.org/download/. In my case, this was this file
- Burn it to CD.
- Boot your server from the rescue CD
- Choose the ‘rescue installed system’ option
- When prompted about mounting system partitions, choose to ‘Skip’.
- Once you get a shell, do something like the following:
# Bring up the volume group
lvm change -a y
# fsck the root filesystem
e2fsck -f /dev/<vgname>/<lvname>
# shrink the root filesystem (ensuring you leave enough space for its data, obviously)
resize2fs /dev/<vgname><lvname> <size>G
# shrink the logical volume
lvm lvreduce -L<size>G /dev/<vgname>/<lvname>
- Reboot and check it has worked okay.