viernes, 10 de agosto de 2012

Eliminando dead paths en Red Hat

Cuando le despresentamos un disco a un servidor Red Hat, es posible que el sistema operativo no sea capaz de actualizar los mpaths de forma automática y nos mantenga los caminos en estado de failed.
En ese caso, tendremos que hacer una limpieza manual.




Generalmente, lo detectaremos haciendo un vgdisplay del VG que estuviera usando ese disco.

root@redhat01/]# vgdisplay -v
    Finding all volume groups
  /dev/mapper/mpath17: read failed after 0 of 4096 at 536871501824: Input/output error
  /dev/mapper/mpath17: read failed after 0 of 4096 at 536871559168: Input/output error
  /dev/mapper/mpath17: read failed after 0 of 4096 at 0: Input/output error
  /dev/mapper/mpath17: read failed after 0 of 4096 at 4096: Input/output error
    /dev/mapper/mpath17: read failed after 0 of 4096 at 0: Input/output error
    Finding volume group "vgdatos"
  --- Volume group ---
  VG Name               vgdatos
  System ID
  Format                lvm2
  Metadata Areas        5
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                5
  Act PV                5
  VG Size               2.44 TB
  PE Size               64.00 MB
  Total PE              40000
  Alloc PE / Size       40000 / 2.44 TB
  Free  PE / Size       0 / 0
  VG UUID               K2qlO1-VKL8-dhPl-h0KE-yHxR-3HPv-x27QpI


 El comando multipath -l nos mostrará el disco en estado failed

[root@redhat01 /]# multipath -l
mpath17 (360000970000292603767533034333136) dm-8 EMC,SYMMETRIX
[size=1000G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:1:1 sdf 8:80  [failed][undef]
 \_ 5:0:2:1 sdh 8:112 [
failed][undef]
 \_ 6:0:1:1 sdj 8:144 [
failed][undef]
 \_ 6:0:2:1 sdl 8:176 [
failed][undef]

Para eliminarlo, tendremos que acceder al daemon del multipath con la opción -k

[root@redhat01 /]# multipathd -k
multipathd> help
fail
multipath-tools v0.4.7 (03/12, 2006)
CLI commands reference:
 list|show paths
 list|show maps|multipaths
 list|show maps|multipaths status
 list|show maps|multipaths stats
 list|show maps|multipaths topology
 list|show topology
 list|show map|multipath $map topology
 list|show config
 list|show blacklist
 list|show devices
 add path $path
 remove|del path $path
 add map|multipath $map
 remove|del map|multipath $map
 switch|switchgroup map|multipath $map group $group
 reconfigure
 suspend map|multipath $map
 resume map|multipath $map
 reinstate path $path
 fail path $path
 disablequeueing map|multipath $map
 restorequeueing map|multipath $map
 disablequeueing maps|multipaths
 restorequeueing maps|multipaths
 resize map|multipath $map

multipathd>

Aquí simplemente tendremos que usar el comando remove (o del) para eliminar el mpath caído.

multipathd> remove multipath mpath17
ok
multipathd>

 
Saldremos del daemon con Ctrl+C

Ahora veremos las salidas de los comandos limpias, pero si reiniciamos el servicio de multipath nos volverán a aparecer.

Tendremos que dar un último paso eliminando los ficheros de dispositivo.

Estos los hemos obtenido anteriormente haciendo un multipath -l

En el ejemplo sdh, sdj, sdf, sdl

Para ello lanzaremos un echo

echo 1 > /sys/block/sdh/device/delete
echo 1 > /sys/block/sdj/device/delete
echo 1 > /sys/block/sdf/device/delete
echo 1 > /sys/block/sdl/device/delete


Y ya veremos las salidas de vgdisplay y multipath limpias.




No hay comentarios: