Centos 6 / 7 system, adjust the home partition, expand the root partition

1. Check the partition status:

df -h

2. Uninstall /home

fuser -km /home/
umount /home

3. Delete the lv where /home is located

lvremove /dev/mapper/centos-home

4. Expand the lv where /root is located, add 800G

lvextend -L +870G /dev/mapper/centos-root

5. Extend the /root filesystem

xfs_growfs /dev/mapper/centos-root

Centos 6 uses the following command:

resize2fs /dev/mapper/centos-root

6. Recreate home lv

lvcreate -L 3G -n /dev/mapper/centos-home

7. Create a file system

mkfs.xfs  /dev/mapper/centos-home

8. mount home

mount /dev/mapper/centos-home

9. Finally, check whether it is successful:

df -h

Guess you like

Origin blog.csdn.net/m0_58606834/article/details/123788309