Tivemos uma falha no disco em um servidor e o substituímos antes de remover a unidade do LVM.
O servidor possui 4 unidades físicas (PVs), cada uma com seu próprio grupo de volumes (VG). Cada VG possui 2 ou mais volumes lógicos (LVs). Agora, o LVM está reclamando da unidade ausente. Portanto, temos um VG (vg04) com dois LVs que se tornaram órfãos do que precisamos limpar do sistema.
O problema é que toda vez que executamos qualquer comando LVM, obtemos estes erros de 'falha na leitura':
# lvscan
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
# vgreduce vg04 --removemissing --force
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
# vgchange -a n /dev/vg04
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
# lvchange -a n /dev/vg04/vz
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
Skipping volume group vg04
Os VG e LV ausentes não são importantes, apenas queremos removê-los.
Como você pode ver, tentamos todas as sugestões feitas, até agora sem sorte.
A saída do 'lvm dumpconfig' pode ser verificada em http://pastebin.com/MHiBzrLJ
remove_all --force --deferred --retry
explodiria toda unidade gerenciada LVM ao seu alcance. Ele continuaria tentando e não desistir, como o Terminator. Estou super curioso sobre o porquê de uma espingarda como essa ser justificada.# dmsetup --force --retry --deferred remove <YOURVG>-<YOURLV>
isso é especialmente verdade, se, por exemplo, um dispositivo iscsi estava pendurado e você o removeu com# iscsiadm -m node -U all -T <FQDN>
Eu experimentei semelhante depois de remover um disco do VMware
/dev/sdb
.Use
lsscsi
para determinar qual dispositivo está sendo usado (pode ser necessário instalar o programa) e executelsscsi
:Agora escreva o arquivo de exclusão com
O dispositivo desapareceu imediatamente.
fonte
Se você tiver volumes lógicos ainda ativos, poderá ser necessário
etc.
fonte
lvchange -a n <VGNAME>
funciona perfekt!