How to move disk space from centos-home to centos-root

Solution 1:

You can reduce your home LV as long as it's unmounted. (please keep in mind that shrinking has some risks )

Go like this:

umount /dev/mapper/centos-home
lvreduce -L 200G /dev/mapper/centos-home

Mount back your home partition as you're done with it.

Then just extend your root volume.

lvextend -t -r -l+100%FREE /dev/mapper/centos-root

-t is test, if it's ok just run the command a second time without -t

Solution 2:

The answer gave by runyoufreak helped me a lot.

I would like to add a tip because when I finished the process of resize partitions, my Cent OS after of a reboot turned on emergency mode. At my case I am not using /home so I commented the partition at /etc/fstab. After that I could to boot my system.


Solution 3:

I forced the unmount by using the command sudo umount -fl /home

then carried on with those instructions.


Solution 4:

Here is a better approach. It shows you how to recreate the mount that you blow away (as this is the easiest way) but is only viable if you don't have too much under that directory tree.

How to shrink /home and add more space on CentOS7

Tags:

Centos7