Linux如何扩容root目录空间(ubuntu server)?

Linux如何扩容root目录空间(ubuntu server)?,第1张

通过命令lsblk结果可判断sda3是个逻辑卷组LVG共928.5G,现在分配了100G的空间创建了逻辑卷LV为根目录/ ,所以可以使用逻辑卷扩容给/增加容量第一步扩容lv, 命令是 lvextend -l 100%FREE /dev/mapper/ubuntu—vgubuntu—lv第二步应用到文件系统/目录这里的命令要根据根目录的文件系统类型来用对应的命令,2种常见的类型是xfs和ext4,xfs的命令是xfs_growfs / ,ext4命令是resize2fs /做完后用df -h查看

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空间

更新文件系统空间


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8468750.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-16
下一篇2023-04-16

发表评论

登录后才能评论

评论列表(0条)

    保存