在 vmware 上为虚拟磁盘添加空间

在 vmware 上为虚拟磁盘添加空间

我有一个带有 2 个虚拟机的 VMWare Server 3.5 系统。在其中一个启动的虚拟机上,我将磁盘大小从 1TB 更改为 1.5TB。但虚拟机没有看到任何新的未分配空间,因此我重新启动了两次服务器。但什么也没发生... 客户机上的操作系统是 CENTOS,两个磁盘是 LVM。fdisk 看到新空间... 但磁盘上没有分区... lvm 没有看到任何可用空间...

[root@srv-archive ~]# dmesg |grep sdb
sd 2:0:1:0: [sdb] 3145728000 512-byte logical blocks: (1.61 TB/1.46 TiB)
sd 2:0:1:0: [sdb] Write Protect is off
sd 2:0:1:0: [sdb] Mode Sense: 61 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:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
 sdb: sda1 sda2
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
dracut: Scanning devices sda2 sdb  for LVM logical volumes vg_srvarchive/lv_swap vg_srvarchive/lv_root

和 fdisk

 # fdisk -l /dev/sdb

Disco /dev/sdb: 1610.6 GB, 1610612736000 byte

255 testine, 63 settori/tracce, 195812 cilindri
Unità = cilindri di 16065 * 512 = 8225280 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x00000000

以下是 pvdisplay,您可以看到 0 可用空间:

# pvdisplay 
--- Physical volume ---
PV Name               /dev/sdb
VG Name               vg_archive
PV Size               1000,00 GiB / not usable 4,00 MiB
Allocatable           yes (but full)
PE Size               4,00 MiB
Total PE              255999
Free PE               0
Allocated PE          255999
PV UUID               3Qftxe-rpff-TjTA-9CA4-BoeM-qEgc-RzSzXL

我只想扩展我的 lvm 设备..非常感谢 cheers luigi

答案1

您可能想尝试不同的方法:

 - Power down the VM     
 - Create a new disk for the VM using the VMWARE control panel with the additional size you want
 - do a pvcreate on the new disk
 - do a vgextend adding the new disk
 - then you can do whatever lvextend you need.
 - REMEMBER the filesystems will need to be extended as well.

答案2

您尝试过吗pvresize /dev/sdb?这是因为您的磁盘大小已更改但lvm您还不知道。

相关内容