我有一个名为 Data 的 2 磁盘 LVM,已经运行了大约 6 个月,最近我购买了第三块磁盘。我在机器中安装了磁盘,并想格式化它并将 lvm 扩展到它上面,就像我之前所做的那样。系统拒绝格式化该磁盘,声称该磁盘已在使用中。我四处寻找可能的解决方案,最终使用 dmsetup remove_all。这使我能够格式化新驱动器,但现在系统似乎 lvm 中的两个磁盘之一出现问题。我不知道下一步是什么。
将尝试包含尽可能多的信息。 Sda 是用于系统/交换等的 500GB 磁盘。Sdb 和 sdc 是两个已经存在的磁盘,sdd 是最新添加的磁盘。 Sdb、sdc和sdd都是3TB磁盘。我基本上只是希望恢复lvm,并且可能包含其中的新磁盘。似乎解决方案就在我面前,我只是不太知道该怎么办。
root@Localhost:~$ sudo lvdisplay
Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
--- Logical volume ---
LV Path /dev/Data/cargo
LV Name cargo
VG Name Data
LV UUID avSFsQ-J49l-twOa-j9KM-Dkeg-JDBE-aG1yWC
LV Write Access read/write
LV Creation host, time Enterprise, 2013-09-22 18:32:06 +0100
LV Status NOT available
LV Size 5.46 TiB
Current LE 1430792
Segments 2
Allocation inherit
Read ahead sectors auto
root@Localhost:~$ sudo vgdisplay
Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
--- Volume group ---
VG Name Data
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 1
VG Size 5.46 TiB
PE Size 4.00 MiB
Total PE 1430792
Alloc PE / Size 1430792 / 5.46 TiB
Free PE / Size 0 / 0
VG UUID rR2QmV-cbjs-rOYu-fU62-uEXp-cVfJ-xVHgRp
root@Localhost:~$ sudo vgchange -ay
Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
Refusing activation of partial LV cargo. Use --partial to override.
0 logical volume(s) in volume group "Data" now active
root@Localhost:~$ sudo vgchange -ay --partial
Partial mode. Incomplete logical volumes will be processed.
Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
Cannot activate Data/cargo: all segments missing.
0 logical volume(s) in volume group "Data" now active
root@Localhost:~$ sudo blkid
/dev/sda7: UUID="200fea91-eed3-4634-8303-ef777e6e60a3" TYPE="swap"
/dev/sdb: UUID="jH6LUK-hTsX-035m-mdSY-zfHp-oBaR-THVnC2" TYPE="LVM2_member"
/dev/sda1: UUID="6144b690-afdd-4bd4-a095-a35da926f6bc" TYPE="ext4"
/dev/sda5: UUID="73df5ee2-33fb-495e-ad20-ad33f82996b1" TYPE="ext4"
/dev/sda6: UUID="d7a9d483-ed4a-4220-bf57-576723c636b8" TYPE="ext4"
/dev/sda8: UUID="b5a9d030-d3af-4dfe-b72a-8180128caa11" TYPE="ext4"
/dev/sda9: UUID="a7c62a16-62ee-406d-ad97-4887c823f40f" TYPE="ext4"
/dev/sdd1: UUID="mWr3pU-WDNn-8cG2-Xt0z-fZvo-wzLe-wK7Dv3" TYPE="LVM2_member"
root@Localhost:~$ sudo fdisk -l
Disk /dev/sda: 500 GB, 500105249280 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 43 345366 83 Linux
Warning: Partition 1 does not end on cylinder boundary.
/dev/sda2 43 60802 488046667 5 Extended
Warning: Partition 2 does not end on cylinder boundary.
/dev/sda5 43 1137 8787555 83 Linux
Warning: Partition 5 does not end on cylinder boundary.
/dev/sda6 1137 1502 2931862 83 Linux
Warning: Partition 6 does not end on cylinder boundary.
/dev/sda7 1502 2285 6289447 82 Linux swap
Warning: Partition 7 does not end on cylinder boundary.
/dev/sda8 2285 2334 393592 83 Linux
Warning: Partition 8 does not end on cylinder boundary.
/dev/sda9 2334 60802 469644210 83 Linux
Warning: Partition 9 does not end on cylinder boundary.
Error: /dev/sdb: unrecognised disk label
Error: /dev/sdc: unrecognised disk label
Disk /dev/sdd: 3000 GB, 3000590369280 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 364802 2930272033 83 Linux
Warning: Partition 1 does not end on cylinder boundary.
picard@Enterprise:~$ sudo pvdisplay -C
Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
PV VG Fmt Attr PSize PFree
/dev/sdb Data lvm2 a-- 2.73t 0
/dev/sdd1 lvm2 a-- 2.73t 2.73t
unknown device Data lvm2 a-m 2.73t 0
答案1
你搞砸了。您被告知无法格式化该磁盘,因为该磁盘正在使用中。它曾是正在使用。您试图格式化现有磁盘之一,而不是新磁盘。现在您格式化了现有驱动器并丢失了数据。您将需要从备份中恢复。
您可以从 pvdisplay 输出中看到 /dev/sdd1 100% 空闲,因此这似乎是新驱动器。