LVM: Couldn't find device with uuid

Este error es uno de esos que no se ven muy a menudo, pero cuando sucede, pues no gusta nada. Estamos ante un sistema con dos discos o dos RAID y todo sobre una partición única de LVM. Uno de los discos tuvo un fallo hardware y ha muerto y el resultado que tenemos es que se perdió el acceso al mismo. La salida del comando pvdisplay nos lo indica lo que estoy aquí comentando.
Donde antes había un dispositivo /dev/sdc1, ahora ya no hay nada. Efectivamente el disco ha muerto y lo hay que cambiar y necesitamos resolver el problema de eliminar el "unknown device" antes de volver a reconstruir el physical volume. En la mayoría de los casos, si queremos sacar un disco del volumen, empleamos el comando pvremove, pero en este caso, ¿qué dispositivo le pasamos como argumento?. No existe ninguno, así que esa opción lo tenemos que descartar.
shell> pvdisplay
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-...
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg0
  PV Size               1,81 TiB / not usable 511,50 KiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              475296
  Free PE               0
  Allocated PE          475296
  PV UUID               vX2z1t-nF17-p5rP-...

  --- Physical volume ---
  PV Name               unknown device
  VG Name               vg0
  PV Size               1,82 TiB / not usable 1,26 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              476847
  Free PE               0
  Allocated PE          476847
  PV UUID               PB7Y0A-qhlM-qfSW-xbhv-
Toda investigar un poco acerca del estado de LVM en nuestro sistema...
shell> pvscan
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  PV /dev/sdb1        VG vg0   lvm2 [1,81 TiB / 0    free]
  PV unknown device   VG vg0   lvm2 [1,82 TiB / 0    free]
  Total: 2 [3,63 TiB] / in use: 2 [3,63 TiB] / in no VG: 0 [0   ]

shell> vgscan
  Reading all physical volumes.  This may take a while...
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  Found volume group "vg0" using metadata type lvm2
Tenemos y debemos de encontrar la solución. Si nos fijamos, nos damos cuenta que el grupo de volúmenes también detecta lo mismo, que un UUID falta y no puede acceder a dichos datos. Puesto que asumimos que el disco está perdido, vamos a sacarlo.
shell> vgreduce --removemissing vg0
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  WARNING: Partial LV srv needs to be repaired or removed.
  WARNING: Partial LV opt needs to be repaired or removed.
  WARNING: There are still partial LVs in VG vg0.
  To remove them unconditionally use: vgreduce --removemissing --force.
  Proceeding to remove empty missing PVs.
Bien, nos dice que lo podemos sacar, pero que está siendo usado actualmente por un volumen lógico. Vamos a pensar un poco: PV -> VG -> LV, de más físico a más lógico, esa es la jerarquía. Así que sí, tiene sentido tener que eliminar los LV, para poder eliminar el VG y así solucionar el problema del PV. Vamos a ello entonces,
shell> lvdisplay
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  --- Logical volume ---
  LV Name                /dev/vg0/home
  VG Name                vg0
  LV UUID                W00ijC-8T2V-0H1T-
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                2,00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Logical volume ---
  LV Name                /dev/vg0/srv
  VG Name                vg0
  LV UUID                6ndFCu-E5n6-3YLV-
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                2,61 TiB
  Current LE             683855
  Segments               5
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/vg0/opt
  VG Name                vg0
  LV UUID                cf18M0-ja1w-8iXC-
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                1,00 TiB
  Current LE             262144
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

shell> lvremove /dev/vg0/srv
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  Logical volume "srv" successfully removed

shell> lvremove /dev/vg0/opt
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  Logical volume "opt" successfully removed
Y ahora probamos nuevamente a sacar el disco perdido del grupo.
shell> vgreduce --removemissing vg0
  Couldn't find device with uuid PB7Y0A-qhlM-qfSW-xbhv-
  Wrote out consistent volume group vg0
Y comprobamos que ha funcionado correctamente.
shell> vgdisplay
  --- Volume group ---
  VG Name               vg0
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  22
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1,81 TiB
  PE Size               4,00 MiB
  Total PE              475296
  Alloc PE / Size       6144 / 24,00 GiB
  Free  PE / Size       469152 / 1,79 TiB
  VG UUID               FrOinx-PLi6-e040-

shell> pvscan
  PV /dev/sdb1   VG vg0   lvm2 [1,81 TiB / 1,79 TiB free]
  Total: 1 [1,81 TiB] / in use: 1 [1,81 TiB] / in no VG: 0 [0   ]
Hemos perdido datos, no por que LVM haya fallado, sino por que un disco falló. Para evitar este tipo de catástrofes están los RAID.



No hay comentarios :

Publicar un comentario

Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Últimos comentarios