Linux 更改root与home分区大小的方法总结

1. 安装了CentOS7.5的虚拟机 但是发现里面的操作系统 home 分区占到了400g 根分区只有50g 认为不太好,所以要改一下.

2.方法. 好像是xfs的文件格式, 没法使用resize2fs 的方式进行处理, 需要使用 xfs_growfs 的方式处理

3. 方法: df -h 查看磁盘情况

4. 然后使用

mount |grep home 

查看 home分区的文件格式

5. 卸载home分区

umount /home

6. 删除home的lv

lvremove /dev/mapper/centos-home

选择是 进行操作

7. 扩展root分区的大小

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

8. 进行 xfs_growfs

xfs_growfs /dev/centos/root

9. 创建home的lv

lvcreate -L 50GB -n home centos

10. 创建文件系统

mkfs.xfs /dev/centos/home

11 挂载

mount /dev/mapper/centos-home

即可

posted @ 2018-05-21 20:30  济南小老虎  阅读(9832)  评论(0编辑  收藏  举报