LVM 系统上的磁盘损坏

LVM 系统上的磁盘损坏

你好,我到处寻找这个案例。

我有一台带有 3 个磁盘的 PC,其中一个主磁盘上的操作系统已完全损坏,另外几个磁盘上带有 LVM

如果我将其安装在 Linux 下,我可以执行以下操作:

    sudo su
root@mint:/home/mint# lvmdiskscan
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
  /dev/loop0 [      <1.90 GiB] 
  /dev/sda   [      20.00 GiB] 
  /dev/sdb   [     100.00 GiB] LVM physical volume
  /dev/sdc   [     100.00 GiB] LVM physical volume
  1 disk
  1 partition
  2 LVM physical volume whole disks
  0 LVM physical volumes

root@mint:/home/mint# lvs
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe

root@mint:/home/mint# fdisk -l
Disk /dev/loop0: 1.92 GiB, 2038923264 bytes, 3982272 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@mint:/home/mint# pvdisplay -m /dev/sdc
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
  WARNING: PV /dev/sdb is marked in use but no VG was found using it.
  WARNING: PV /dev/sdb might need repairing.
  WARNING: PV /dev/sdc is marked in use but no VG was found using it.
  WARNING: PV /dev/sdc might need repairing.
  "/dev/sdc" is a new physical volume of "100.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdc
  VG Name               
  PV Size               100.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               1FFrM1-IBhH-tzXz-qOKa-SPpw-CaWz-MfPBoe

root@mint:/home/mint# pvdisplay -m /dev/sdb
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
  WARNING: PV /dev/sdb is marked in use but no VG was found using it.
  WARNING: PV /dev/sdb might need repairing.
  WARNING: PV /dev/sdc is marked in use but no VG was found using it.
  WARNING: PV /dev/sdc might need repairing.
  "/dev/sdb" is a new physical volume of "100.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb
  VG Name               
  PV Size               100.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               2rZsV6-hciO-dRX2-QpNL-UUEU-4oQS-020ulF

root@mint:/home/mint# pvs -a -v
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
  WARNING: PV /dev/sdb is marked in use but no VG was found using it.
  WARNING: PV /dev/sdb might need repairing.
  WARNING: PV /dev/sdc is marked in use but no VG was found using it.
  WARNING: PV /dev/sdc might need repairing.
  PV         VG        Fmt  Attr PSize   PFree DevSize PV UUID                               
  /dev/loop0                ---       0     0   <1.90g                                       
  /dev/sda                  ---       0     0   20.00g                                       
  /dev/sdb   [unknown] lvm2 u--  100.00g    0  100.00g 2rZsV6-hciO-dRX2-QpNL-UUEU-4oQS-020ulF
  /dev/sdc   [unknown] lvm2 u--  100.00g    0  100.00g 1FFrM1-IBhH-tzXz-qOKa-SPpw-CaWz-MfPBoe

root@mint:/home/mint# pvs
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
  WARNING: PV /dev/sdb is marked in use but no VG was found using it.
  WARNING: PV /dev/sdb might need repairing.
  WARNING: PV /dev/sdc is marked in use but no VG was found using it.
  WARNING: PV /dev/sdc might need repairing.
  PV         VG        Fmt  Attr PSize   PFree
  /dev/sdb   [unknown] lvm2 u--  100.00g    0 
  /dev/sdc   [unknown] lvm2 u--  100.00g    0 

root@mint:/home/mint# vgs
  WARNING: Metadata location on /dev/sdb at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdb in mda1
  WARNING: scanning /dev/sdb mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdb with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdb PVID 2rZsV6hciOdRX2QpNLUUEU4oQS020ulF
  WARNING: Metadata location on /dev/sdc at 5632 begins with invalid VG name.
  WARNING: bad metadata text on /dev/sdc in mda1
  WARNING: scanning /dev/sdc mda1 failed to read metadata summary.
  WARNING: repair VG metadata on /dev/sdc with vgck --updatemetadata.
  WARNING: scan failed to get metadata summary from /dev/sdc PVID 1FFrM1IBhHtzXzqOKaSPpwCaWzMfPBoe
root@mint:/home/mint# 

如果是,我应该创建一个 VG 文件吗?如何创建?我不知道如何设置 dev_size、pe_start、pe_count 的正确大小

pv1 {
            id = "57aqQz-eQud-0PNI-huvi-2flz-GgWR-AjdBW5"
            device = "/dev/sdc" # Hint only

            status = ["ALLOCATABLE"]
            flags = []
            dev_size = 41943040 # 20 Gigabytes
            pe_start = 2048
            pe_count = 5119 # 19.9961 Gigabytes
        }

相关内容