我有一台基于 VMWARE 的虚拟机,由于卸载一些重要的库而崩溃了。
现在我想将其 vmdk 文件作为磁盘挂载到另一台虚拟机上,但失败了。
该磁盘在 fdisk 中可见。
Disk /dev/sdd: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000402ed
Device Boot Start End Blocks Id System
/dev/sdd1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdd2 502 30720 30944256 8e Linux LVM
Partition 2 does not end on cylinder boundary.
现在,当我尝试创建物理卷时,出现以下错误。
# pvcreate /dev/sdd2
dev_is_mpath: failed to get device for 8:50
Can't initialize physical volume "/dev/sdd2" of volume group "vg_mon01" without -ff
光伏显示器
# pvdisplay /dev/sdd2
--- Physical volume ---
PV Name /dev/sdd2
VG Name vg_mon01
PV Size 29.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7554
Free PE 0
Allocated PE 7554
PV UUID mzEURV-XSSx-8I3Z-y43s-MQNk-qMo2-GsAlbt
显示
#vgdisplay vg_mon01
--- Volume group ---
VG Name vg_mon01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 29.51 GiB
PE Size 4.00 MiB
Total PE 7554
Alloc PE / Size 7554 / 29.51 GiB
Free PE / Size 0 / 0
VG UUID qrELxN-WtX5-y7ZB-u8bk-LIrO-3Ctp-In7gi4
lv显示器
lvdisplay vg_mon01
--- Logical volume ---
LV Path /dev/vg_mon01/lv_root
LV Name lv_root
VG Name vg_mon01
LV UUID owQu23-Xp1A-Sh9z-pcv9-3baB-BXcL-LVn45Y
LV Write Access read/write
LV Creation host, time mon01.mfino.net, 2015-05-13 10:35:44 +0530
LV Status NOT available
LV Size 27.57 GiB
Current LE 7058
Segments 1
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Path /dev/vg_mon01/lv_swap
LV Name lv_swap
VG Name vg_mon01
LV UUID 6eOpOI-eTst-i7fY-WPbr-RMtY-dWMR-7d6Awt
LV Write Access read/write
LV Creation host, time mon01.mfino.net, 2015-05-13 10:35:50 +0530
LV Status NOT available
LV Size 1.94 GiB
Current LE 496
Segments 1
Allocation inherit
Read ahead sectors auto
这里我不知道这是否是使用现有 LVM 分区磁盘的正确方法,或者我遗漏了一些东西。
答案1
当我添加磁盘时,虚拟机检测到了它,但 LV 状态无法使用,我重启虚拟机后,LV 状态变为可用的而且我能够毫无问题地安装它。