![无法扩展LVM磁盘分区](https://linux22.com/image/160197/%E6%97%A0%E6%B3%95%E6%89%A9%E5%B1%95LVM%E7%A3%81%E7%9B%98%E5%88%86%E5%8C%BA.png)
我正在尝试为我的托管添加更多空间,我有一个 eCloud VM,我通过仪表板添加了 10 GB 空间(它使用 VMware 工具),现在支持人员告诉我,增加的空间已分配给系统:
Disk /dev/sdb: 167.5 GB, 167503724544 bytes
255 heads, 63 sectors/track, 20364 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb50df193
Device Boot Start End Blocks Id System
/dev/sdb1 1 3916 31455238+ 83 Linux
/dev/sdb2 3917 12401 68155762+ 8e Linux LVM
/dev/sdb3 12402 20364 63962797+ 8e Linux LVM
我需要扩展LVM分区以将新分区添加到我想要增加的分区中。
我已经关注了他们的向导但我遇到了一些错误并且 WHM 仍然没有看到增加的空间。
这是我的设置:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 eCloud lvm2 a--u 9.80g 0
/dev/sdb1 eCloud lvm2 a--u 30.00g 0
/dev/sdb2 eCloud lvm2 a--u 65.00g 0
/dev/sdb3 eCloud lvm2 a--u 50.00g 0
# vgs
VG #PV #LV #SN Attr VSize VFree
eCloud 4 2 0 wz--n- 154.79g 0
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root eCloud -wi-ao---- 153.79g
swap eCloud -wi-ao---- 1.00g
# dmesg
sd 2:0:0:0: [sda] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB)
sd 2:0:1:0: [sdb] 327155712 512-byte logical blocks: (167 GB/156 GiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 31 00 00 00
sd 2:0:0:0: [sda] Cache data unavailable
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:1:0: [sdb] Write Protect is off
sd 2:0:1:0: [sdb] Mode Sense: 31 00 00 00
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sda] Cache data unavailable
sd 2:0:0:0: [sda] Assuming drive cache: write through
sda:
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sdb: sda1 sda2
sdb1 sdb2 sdb3
sd 2:0:0:0: [sda] Cache data unavailable
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Attached SCSI disk
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sd 2:0:1:0: [sdb] Attached SCSI disk
# fdisk -l /dev/sda
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000301ba
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 1306 10279936 8e Linux LVM
该指南说,在这种情况下,它是额外的磁盘,我需要为新设备 (sda) 创建一个新的物理卷,以便我们可以在 LVM 中使用它,但当我这样做时,我收到以下消息:
# pvcreate /dev/sda
Device /dev/sda not found (or ignored by filtering).
如何让新空间在WHM中可见?我不明白出了什么问题...
答案1
我认为他们扩展了 /dev/sdb 磁盘
Disk /dev/sdb: 167.5 GB
大约为 156 GiB。如果检查 /dev/sdbX 大小,您当前在该磁盘上使用约 145 GiB。所以还有 ~10GiB 空闲空间
/dev/sdb1 eCloud lvm2 a--u 30.00g 0 /dev/sdb2 eCloud lvm2 a--u 65.00g 0 /dev/sdb3 eCloud lvm2 a--u 50.00g 0
在这种情况下,您应该创建新的 lvm 分区 /dev/sdb4
fdisk /dev/sdb
完成流程,然后在 /dev/sdb4 上创建 pv
pvcreate /dev/sdb4
最后将 /dev/sdb4 添加到卷组:
vgextend eCloud /dev/sdb4