Shrinking or removing home partition in CentOS 7 installation [closed]

I made the mistake of creating a home partition that fills up all my disk space, and it's formatted in XFS, which to my knowledge isn't shrinkable.

Since I have no use for the home partition anyway (I'm always root), can I just lvremove /dev/mapper/centos-home and reclaim the unused space with lvcreate? I notice when I lvremove it, my Free PE/SIZE increased from 0 to a large value in vgdisplay.

Thanks.


Solution 1:

Yes, XFS doesn't shrink.

Yes, there is no mandatory requirement to have /home as a separate file-system (although a number of reasons to do so are listed here)

Back-up the contents of /home, unmount the home directory and discard the logical volume with lvremove and the blocks you had assigned will be returned to the volume group as free space, which can be used for new volumes with lvcreate or to expand existing logical volumes and file-systems.
Then restore the back-up of /home and don't forget to remove the entry in /home from /etc/fstab.

I won't comment on your habit of doing everything as root ;)