How to decrease /home and increase / on the same VG

lvm vg lv
  • Examine the current filesystem size.

# df -h

  • Check to see if any processes are using /home, then umount it and double-check.

# umount /home
# df -h

  • Reduce the size of the /home filesystem. The below command will remove free space from the filesystem.

# e2fsck -f /dev/mapper/vg_01-lv_home
# resize2fs /dev/mapper/vg_01-lv_home 1G

  • Now reduce /home with the following command.

# lvreduce -L 2G /dev/mapper/vg_01-lv_home

  • Extend the / or root filesystem.

# lvextend -l +100%FREE /dev/mapper/vg_01-lv_root
# resize2fs /dev/mapper/vg_01-lv_root

  • Now mount /home.

# mount /home

  • Finally, confirm the size of the new size of /home filesystem.

# df -h

Leave a Reply

Your email address will not be published. Required fields are marked *