在另一台虛擬機器上安裝基於lvm的vmware磁碟文件

在另一台虛擬機器上安裝基於lvm的vmware磁碟文件

我有一個基於 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

當我新增磁碟時,VM 會偵測到它,但 LV 狀態為無法使用,我重新啟動VM後,LV Status變成可用的我能夠毫無問題地安裝它。

相關內容