I've setup RHEL7 with default partitioning, and they partitioned it as following:

/dev/mapper/rhel-home 100GB /home
/dev/mapper/rhel-root 50GB /

Both are on xfs filesystem. How can i shift most of my diskspace from /home to / ?

I've tried the below code

umount /home
lvreduce -rL -10G /dev/mapper/rhel-home
lvextend -rL +10G /dev/mapper/thel-root

But it doesnt seem to work because xfs file system does not support shrinking.

  • Let's see your outputs of 'pgdisplay', 'vgdisplay' and 'lvdisplay' please – Chopper3 May 12 '16 at 9:52
  • Not to mention df. – Law29 May 12 '16 at 10:50

Assuming you have space in your root filesystem, I would do:

mkdir /opt/home && mv /home/* /opt/home && umount /home && rmdir /home && ln -s /opt/home /home

At this point you can destroy your rhel-home volume and recreate it again with the desired (shrinked) size, adding the remaining space to your rhel-root volume, then:

rm /home && mkdir /home &&  mount /home && mv /opt/home/* /home/ && rmdir /opt/home

I know seems complicated but it works.

| improve this answer | |
  • for your second command, should it be mkdir /home instead of rm /home? – stiffy May 12 '16 at 10:03
  • it's the link that points to /opt/home created in the first command, so yes, it's rm. But you're roght, i missed a mkdir. Fixed thnx! – Fredi May 12 '16 at 10:09
  • Do you happen to have a guide for destroy and recreating of logical volume – stiffy May 12 '16 at 10:18
  • You can check here: tldp.org/HOWTO/LVM-HOWTO/index.html – Fredi May 12 '16 at 10:36
  • appreciate the advice Fredi =) – stiffy May 12 '16 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.