RockyLinux File extend drive FYI

Just a quick reminder, for myself 😉

Needed to resize a partition on RockyLinux 9.5
And wanted to document that.

So this was a /home partition, on a LVM system.

Steps I took:

  • Backup /home –> tar -czvf /root/home.tgz -C /home .
  • Test Backup –> tar -tvf /root/home.tgz
  • unmount /home –> umount /dev/mapper/rl_<NAME_OF_MACHINE>-home
  • Remove logical volume –> lvremove /dev/mapper/rl_<NAME_OF_MACHINE>-home
  • Recreate new /home (250GB) –> lvcreate -L 250GB -n home rl_<NAME_OF_MACHINE>
  • Format –> mkfs.xfs /dev/rl_<NAME_OF_MACHINE>/home
  • Mount –> mount /dev/mapper/rl_<NAME_OF_MACHINE>-home
  • Extend /root –> lvextend -r -l +100%FREE /dev/mapper/rl_<NAME_OF_MACHINE>-root
  • Restore backup –> tar -xzvf /root/home.tgz -C /home

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.