Redhat: Adjust LVM Partition Size

Check file system and LVM info

1
2
3
4
5
6
7
# df -hT |grep rhel
/dev/mapper/rhel-root xfs 50G 49G 1G 99%
/dev/mapper/rhel-home xfs ... ... ... ...
# lsblk
# lvs -v
# vgs -v
# pvs -v

Backup /home

1
# tar zcf /p/home.tgz -C /home .

Unmount /home

1
# umount -l /dev/mapper/rhel-home

Remove the /home logical volume

1
# lvremove /dev/mapper/rhel-home

Recreate a new 500GB logical volume from /home, format and mount it

1
2
3
# lvcreate -L 500GB -n home rhel
# mkfs.xfs /dev/rhel/home
# mount /dev/mapper/rhel-home

Extend your /root volume with all remaining space and resize (-r) the file system

1
# lvextend -r -l +100%FREE /dev/mapper/rhel-root

Restore your backup of /home

1
# tar xvf /p/home.tgz -C /home

Sync the changes

1
# dracut --regenerate-all --force