Esta é uma máquina rodando o Fedora 28 com um disco rígido. Eu coloquei em outro disco rígido para ver se conseguia extrair dados dele (Não), mas depois que eu o removi (de volta para uma unidade) eu descobri que ele tinha bagunçado os dados pv e lv:
[root@localhost-live ~]# pvscan
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
PV /dev/sda2 VG vg_debussy lvm2 [931.00 GiB / 0 free]
PV [unknown] VG vg_debussy lvm2 [931.50 GiB / 0 free]
Total: 2 [<1.82 TiB] / in use: 2 [<1.82 TiB] / in no VG: 0 [0 ]
[root@localhost-live ~]# vgscan
Reading volume groups from cache.
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
Found volume group "vg_debussy" using metadata type lvm2
[root@localhost-live ~]# lvs
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_home vg_debussy -wi-----p- 1.75t
lv_root vg_debussy -wi-a----- 50.00g
lv_swap vg_debussy -wi-ao---- <17.69g
[root@localhost-live ~]# lvscan
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
ACTIVE '/dev/vg_debussy/lv_root' [50.00 GiB] inherit
inactive '/dev/vg_debussy/lv_home' [1.75 TiB] inherit
ACTIVE '/dev/vg_debussy/lv_swap' [<17.69 GiB] inherit
e eu não consegui ativar o lv_home
O motivo parece ser um volume físico duplicado com o mesmo nome de VG:
[root@localhost-live ~]# pvdisplay
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_debussy
PV Size 931.02 GiB / not usable 24.00 MiB
Allocatable yes (but full)
PE Size 32.00 MiB
Total PE 29792
Free PE 0
Allocated PE 29792
PV UUID KSk5KO-Su5d-H8LO-a8t0-s8gH-WdWA-DXQZTr
--- Physical volume ---
PV Name [unknown]
VG Name vg_debussy
PV Size 931.51 GiB / not usable 12.00 MiB
Allocatable yes (but full)
PE Size 32.00 MiB
Total PE 29808
Free PE 0
Allocated PE 29808
PV UUID F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1
Então é aí que eu cometi o meu erro (seguindo o que alguém escreveu que supostamente funcionou):
[root@localhost-live ~]# vgreduce --removemissing --force vg_debussy
WARNING: Device for PV F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1 not found or rejected by a filter.
WARNING: Removing partial LV vg_debussy/lv_home.
Logical volume "lv_home" successfully removed
Wrote out consistent volume group vg_debussy.
[root@localhost-live ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_debussy
PV Size 931.02 GiB / not usable 24.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 29792
Free PE 27626
Allocated PE 2166
PV UUID KSk5KO-Su5d-H8LO-a8t0-s8gH-WdWA-DXQZTr
[root@localhost-live ~]# lvscan
ACTIVE '/dev/vg_debussy/lv_root' [50.00 GiB] inherit
ACTIVE '/dev/vg_debussy/lv_swap' [<17.69 GiB] inherit
Então, eu removi os dois lv_home - o do PV ausente e o que eu queria manter!
[root@localhost-live ~]# vgcfgrestore vg_debussy --test -f /etc/lvm/archive/vg_debussy_00000-611197733.vg
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
/dev/cdrom: open failed: No medium found
Couldn't find device with uuid F3lvXa-42cI-6Tx2-hmSr-3E0M-0PFE-W7kLj1.
Cannot restore Volume Group vg_debussy with 1 PVs marked as missing.
Restore failed.
Então, o que posso fazer agora? Estou executando isso em um USB ao vivo.
Tags hard-drive lvm linux