Volume lógico LVM bloqueado no VG com PV ausente

4

Então, eu tive uma falha de disco e movi LVs do disco com defeito para os novos PVs. Alguns LVs foram movidos com sucesso, outros não. Depois acabei com o seguinte estado: - dois LVs bloqueados - grupo de volume com PV ausente

Quando tento remover o PV, recebo:

vgreduce --removemissing --force vg3
  Couldn't find device with uuid RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP.
  Removing partial LV var.
  Can't remove locked LV var

lvremove -fff vg3/var
  Couldn't find device with uuid RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP.
  Can't remove locked LV var

pvmove --abort
  Couldn't find device with uuid RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP.
  Cannot change VG vg3 while PVs are missing.
  Consider vgreduce --removemissing.
  Skipping volume group vg3

Eu também tentei executar o vcfgbackup e restaurar depois de editar os bloqueios, mas sem sucesso:

vgcfgrestore --force vg3
  Couldn't find device with uuid RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP.
  Cannot restore Volume Group vg3 with 1 PVs marked as missing.
  Restore failed.

Então eu fui ainda mais longe, e inseri o disco de volta - ele falhou, mas ele é detectado por um tempo.

vgreduce --removemissing vg3
  /dev/vg3/var: read failed after 0 of 4096 at 9638445056: Input/output error
  /dev/vg3/var: read failed after 0 of 4096 at 9638502400: Input/output error
  WARNING: Partial LV var needs to be repaired or removed.
  WARNING: Partial LV pvmove1 needs to be repaired or removed.
  There are still partial LVs in VG vg3.
  To remove them unconditionally use: vgreduce --removemissing --force.
  Proceeding to remove empty missing PVs.

lvremove -fff vg3/var
  /dev/vg3/var: read failed after 0 of 4096 at 9638445056: Input/output error
  /dev/vg3/var: read failed after 0 of 4096 at 9638502400: Input/output error
  Can't remove locked LV var

pvmove --abort
  /dev/vg3/var: read failed after 0 of 4096 at 9638445056: Input/output error
  /dev/vg3/var: read failed after 0 of 4096 at 9638502400: Input/output error
  Cannot change VG vg3 while PVs are missing.
  Consider vgreduce --removemissing.
  Skipping volume group vg3

E este é o momento em que estou sem ideias.

    
por macronus 06.07.2016 / 12:40

1 resposta

1

Semelhante a Não é possível remover o grupo de volumes , resolveu esse problema criando um pv temporário com o mesmo uuid:

UUID="RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP"  # from question
dd if=/dev/zero of=/tmp/tmp.raw bs=1M count=100 
losetup -f
losetup /dev/loop0 tmp.raw
pvcreate --norestorefile -u $UUID /dev/loop0   # it has arisen!
killall lvmetad      # so it stops complaining about duplicate uuids
pvremove /dev/loop0  # a clean removal 
losetup -D
pvscan --cache       # to restart lvmetad

Temporada com vgreduce etc., se necessário.

    
por 03.12.2018 / 20:51