
在硬盘或分区上创建物理卷PV,例如新硬盘为sdb
pvcreate
/dev/sdb
vgextend
vgname
/dev/sdb
扩展逻辑卷LV,例如:文件系统所在的LV名为lvname,增加10G
lvextend
+L
10G
/dev/vgname/lvname
扩展文件系统
resize2fs
/dev/vgname/lvname
如果没用逻辑卷管理,文件系统是无法扩展的;如果逻辑卷有足够的剩余空间(vgdisplay可看),第1、2、3步可省略
linux服务器通过multipath多路径连接到共享存储,那么当文件系统空间不足的时候,有几种方式可以扩展文件系统的大小:
1、pv不变,原lun存储扩大容量,扩大lv,扩大文件系统
2、新增pv,加入到vg中,扩大lv,扩大文件系统
下文是针对场景1的情况下如何 *** 作(但是个人建议采取新建pv的方式2进行):
Environment
If you have this specific scenario, you can use the following steps:
Note: if these lv's are part of a clustered vg, steps 1 and 2 need to be performed on all nodes. 注意:集群模式下步骤1和步骤2两个节点都需要执行。
1) Update block devices
Note: This step needs to be run against any sd devices mapping to that lun. When using multipath, there will be more than one. 通过multipath -ll命令查看每个聚合卷对应的路径。
2) Update multipath device
例子:
3) Resize the physical volume, which will also resize the volume group
4) Resize your logical volume (the below command takes all available space in the vg)
5) Resize your filesystem
6) Verify vg, lv and filesystem extension has worked appropriately
模拟存储端扩容testlv增加
查看客户端多路径情况
客户端更新存储
更新聚合设备
更新pv空间
更新lv空间
更新文件系统空间
/boot只装了10-20M的文件,你给200G干嘛?用到天崩地裂海枯石烂天荒地老你那200G都用不完。/usr存储源码安装的默认路径,软件装得多这个目录要大
/var存储日志,这个目录要大
/home,多用户的时候这个分区要大
先分一个200G分区,把一个关键系统目录内容copy过去,然后在fstab里修改指向。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)