调整逻辑卷组大小

嗨ServerFault社区。

对于这个卷组:

--- Volume group --- VG Name virtual-machines System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 117,18 GiB PE Size 4,00 MiB Total PE 29999 Alloc PE / Size 25600 / 100,00 GiB Free PE / Size 4399 / 17,18 GiB VG UUID iXdHIW-f7eR-aAb2-DHxR-ybAv-dQCy-oBA1Um 

包含这个逻辑卷

  --- Logical volume --- LV Name /dev/virtual-machines/win7x64 VG Name virtual-machines LV UUID 2CXriq-v3M2-dVkG-j8JI-dGUD-yyph-r9waRs LV Write Access read/write LV Status available # open 0 LV Size 100,00 GiB Current LE 25600 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0 

我想通过添加另一个逻辑卷

 lvcreate -L 100G -n win7x64-gaming virtual-machines 

但它说

 Insufficient free extents (4399) in volume group virtual-machines: 25600 required 

所以我想重新调整vg,但是我没有find像vgresize一样的东西。 我怎么能设法添加这个新的LV?

编辑:我拿了一个空的硬盘,只是叫lvcreate,所以我认为以下是有趣的你。

  --- Physical volume --- PV Name /dev/sdb1 VG Name virtual-machines PV Size 117,19 GiB / not usable 4,00 MiB Allocatable yes PE Size 4,00 MiB Total PE 29999 Free PE 4399 Allocated PE 25600 PV UUID iXZ9sf-UMnI-azYF-2h0v-dCt3-44GB-NwT7v9 

“但是我没有find像vgresize这样的东西” – >它确实存在,它被命名为vgextend

编辑:如果我猜对了,你已经有一个磁盘/ dev / sdb1,一个vg称为虚拟机和一个LV win7x64。 现在你想创build另一个100G LV,但没有enouch空间,所以你想添加另一个磁盘。

  • 步骤1:确定新的磁盘。 你可以例如尝试dmesg。
  • 步骤2:在新磁盘上(或新磁盘的一个分区上)创build一个PV。 为此使用pvcreate。

  • 步骤3:使用vgextend向现有的VG添加新的PV

  • 第四步:用上面的命令创build新的LV。