Reference:
https://wuliangx.wordpress.com/2017/02/08/centos-7-remove-home-partition-and-extend-root-partition/
How?
-
Unmount home partiton
umount /home -
Show logical volumes and look for the home volume.
lvdisplay
.
.
— Logical volume —
LV Path /dev/myhost/home
LV Name home
VG Name centos
.
.
3. Remove the home volume
lvremove /dev/myhost/home
-
Verify that you have free space.
vgs -
Take note of where your root is located
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/myhost-root 50G 1.2G 49G 3% /
.
.
6. Resize root partition to reclaim all free space.
lvextend -l +100%FREE /dev/mapper/myhost-root
- Remove the line containing the home directory from /etc/fstab
- Reboot.