Centos根目录(/dev/mapper/centos-root)扩容

1、查看磁盘分配情况。

[root@localhost ~]# df -h

2、备份home目录。

[root@localhost ~]# tar cvf /run/home.tar /home/

3、卸载home目录

[root@localhost ~]# fuser -km /home/

[root@localhost ~]# umount /home/

4、删除home所在的逻辑卷lv

[root@localhost ~]# lvremove /dev/mapper/centos-home

Do you really want to remove active logical volume centos/home? [y/n]: y

5、扩大根目录所在的卷,+200G

[root@localhost ~]# lvextend -L +200G /dev/mapper/centos-root

[root@localhost ~]# xfs_growfs /dev/mapper/centos-root

6、恢复home逻辑卷

[root@localhost ~]# lvcreate -L 2.2T -n/dev/mapper/centos-home

[root@localhost ~]# mkfs.xfs /dev/mapper/centos-home

[root@localhost ~]# mount /dev/mapper/centos-home

[root@localhost ~]# tar xvf /run/home.tar -C /

[root@localhost ~]# rm -rf /run/home.tar

7、操作过程记录截图

​​​​

你可能感兴趣的:(Centos根目录(/dev/mapper/centos-root)扩容)