云VPS使用 LVM 创建文件系统增加容量并扩容实战

原创 淹不死的狗  2025-12-12 01:54:30  阅读 7 次 评论 0 条
摘要:

使用 LVM 创建文件系统root@VM-ps7EhmYE:~# pvcreate /dev/sda3 创建成功的输出如下:   Physical volume "/dev/sda3" successfully created.使用 pvs 命令查看所有的 PV:root@VM-ps7EhmYE:~# pvs   PV   &n

图片.png 云VPS使用 LVM 创建文件系统增加容量并扩容实战 网站相关

使用 LVM 创建文件系统

root@VM-ps7EhmYE:~# pvcreate /dev/sda3

创建成功的输出如下:
  Physical volume "/dev/sda3" successfully created.

使用 pvs 命令查看所有的 PV:

root@VM-ps7EhmYE:~# pvs
  PV         VG     Fmt  Attr PSize   PFree 
  /dev/sda3         lvm2 ---   50.00g 50.00g
  /dev/sda5  debian lvm2 a--  <99.07g     0

 


把 /dev/sda3 加入到  debian 

root@VM-ps7EhmYE:~# vgextend debian /dev/sda3

  Volume group "debian" successfully extended


扩展lv,

root@VM-ps7EhmYE:~# lvextend -l +100%FREE /dev/debian/root /dev/sda3
创建成功的输出如下: 
  Size of logical volume debian/root changed from 95.25 GiB (24385 extents) to 145.25 GiB (37184 extents).
  Logical volume debian/root successfully resized.

使用df -h   命令查看文件系统路径路径

对齐文件系统边界 (使用df -h   命令查看出的路径)

xfs_growfs /dev/mapper/debian-root


本文地址:https://tugouli.exiu.org/3731.html
版权声明:本文为原创文章,版权归 淹不死的狗 所有,欢迎分享本文,转载请保留出处!
NEXT:已经是最新一篇了

发表评论


表情

还没有留言,还不快点抢沙发?