How to shrink the root volume on a Scientific Linux (RHEL6) installation:

  1. Make backups first. This could trash your Linux installation if something goes wrong.
  2. Get the appropriate rescue disk (boot.iso) fromhttp://www.scientificlinux.org/download/. In my case, this was this file
  3. Burn it to CD.
  4. Boot your server from the rescue CD
  5. Choose the ‘rescue installed system’ option
  6. When prompted about mounting system partitions, choose to ‘Skip’.
  7. Once you get a shell, do something like the following:


    # Bring up the volume group
    vgchange -a y

  8. # fsck the root filesystem
    e2fsck -f /dev/<vgname>/<lvname>

  9. # shrink the root filesystem (ensuring you leave enough space for its data, obviously)
    resize2fs /dev/<vgname><lvname> <size>G

  10. # shrink the logical volume
    lvreduce -L<size>G /dev/<vgname>/<lvname>

  11. Reboot and check it has worked okay.

------------------------------------------------------------------------------------------------------------

How to resize root file system on RHEL 6

Here is the list of steps to reduce the  root file system (lv_root) on a RHEL 6 Linux server:

  • Boot the system into rescue mode. Do not mount the file systems (select the option to 'Skip' in the rescue mode and start a shell)
  • Bring the Volume Group online
    • #lvm vgchange -a -y
  • Run fsck on the FS
    • #e2fsck -f /dev/vg_myhost/lv_root
  • Resize the file system with new size
    • #resize2fs -f /dev/vg_myhost/lv_root 20G
  • Reduce the Logical Volume of the FS with the new size
    • #lvreduce -L20G /dev/vg_myhost/lv_root
  • Run fsck to make sure the FS is still ok
    • #e2fsck -f /dev/vg_myhost/lv_root
  • Optionally mount the file system in the rescue mode
    • #mkdir -p /mnt/sysimage/root
    • #mount -t ext4 /dev/mapper/vg_myhost-lv_root /mnt/sysimage/root
    • #cd /mnt/sysimage/root
  • Unmount the FS
    • #cd
    • #umount /mnt/sysimage/root
  • Exit rescue mode and boot the system from the hard disk
    • #exit
  • Select the reboot option from the recue mode


+ Recent posts