把/home內容備份,然后將/home文件系統所在的邏輯卷刪除,擴大/root文件系統,新建/home:
tar cvf /tmp/home.tar /home #備份/home
umount /home #卸載/home,如果無法卸載,先終止使用/home文件系統的進程
lvremove /dev/centos/home #刪除/home所在的lv
lvextend -L +50G /dev/centos/root #擴展/root所在的lv,增加50G
xfs_growfs /dev/centos/root #擴展/root文件系統
lvcreate -L 56G -n home centos #重新創建home lv
mkfs.xfs /dev/centos/home #創建文件系統
mount /dev/centos/home /home #掛載
df -h
轉載LPI-OSS 團隊 bigbigtiger17