centos7扩展根目录/
https://www.yuque.com/alipayeut69c4uex/txovd5/cte3uy
现在根目录centos-root可用空间为2.6G
这是第一块磁盘,快满了
这是新挂载的磁盘,还没用,没加入到根目录
下面开始用新磁盘sdb扩展根目录
-
创建分区
/dev/sdb
,注意选择 8e 也即是 LVM 类型
这是各种操作
- 依次输入n,p,1,回车,回车,t,8e,w
n是创建新分区,t是定义新分区类型,8e是Linux LVM类型的代码,w 完成修改
-
输入fdisk -l 看到已经存在分区
/dev/sdb1
了,刚开始输入fdisk -l的时候是没有 设备 ,boot那两行的
- 创建 PV
-
查看 LV,显示 LV Path 为
/dev/centos/root
,VG Name 为 centos
- 扩展 VG centos
-
扩展 LV
/dev/centos/root
- 如果系统是用的XFS文件系统,需要要运行以下命令:
xfs_growfs /dev/centos/root
-
查看磁盘空间信息,
/dev/mapper/centos-root
已经扩充到13G了