[CentOS] CentOS 7 - xfs shrink & expand

Wed May 13 05:48:12 UTC 2020
Simon Matter <simon.matter at invoca.ch>

Hi,

> I'm having some difficulty finding a method to shrink my /home to expand
> my /.  They both correspond to LVMs.  It is my understanding that one
> cannot shrink a xfs filesystem.  One must back it up (xfsdump), remove
> (lvremove) redefine it and then restore it back (xfsrestore).
>
> Okay, I'm running into a problem where /home  needs to be "unused".  If
> tried going in to "maintance mode", but I ran into a problem with the
> mount command (after issuing a 'chroot /sysroot').  I then tried using
> SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive
> (something about too big).
>
> Any thoughts or suggestions?

What is the problem if you boot directly into maintenance mode? Then it
should be possible to backup home to a remote destination, unmount /home,
remove the home LV, expand /, recreate home and mount it, restore from
backup and you're done. No need to use any SystemRescueCD or other tool.

Regards,
Simon