lunes, 26 de mayo de 2008

LINUX: Control RAID fisico discos

En mi caso, para poder gestionar el RAID 1 de discos de mi máquina y el estado del mismo utilizo mpt-status.

Esta utilidad es buena para ver el estado de salud del mismo, sobre todo cuando tenemos un error como este:

Jun 26 11:22:43 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0
Jun 26 11:22:43 my_host kernel: mptbase: ioc0: PhysDisk is now missing
Jun 26 11:22:43 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0
Jun 26 11:22:43 my_host kernel: mptbase: ioc0: PhysDisk is now missing, out of sync
Jun 26 11:22:43 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0
Jun 26 11:22:43 my_host kernel: mptbase: ioc0: volume is now degraded, enabled
Jun 26 11:22:43 my_host kernel: klogd 1.4.1, ---------- state change ----------
Jun 26 11:22:49 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0
Jun 26 11:22:49 my_host kernel: mptbase: ioc0: PhysDisk is now online, out of sync
Jun 26 11:22:49 my_host kernel: sdb : READ CAPACITY failed.
Jun 26 11:22:49 my_host kernel: sdb : status=0, message=00, host=1, driver=00
Jun 26 11:22:49 my_host kernel: sdb : sense not available.
Jun 26 11:22:49 my_host kernel: sdb: Write Protect is off
Jun 26 11:22:49 my_host kernel: sdb: Mode Sense: 00 00 00 00
Jun 26 11:22:49 my_host kernel: sdb: asking for cache data failed
Jun 26 11:22:49 my_host kernel: sdb: assuming drive cache: write through
Jun 26 11:22:49 my_host kernel: sd 0:1:1:0: Attached scsi disk sdb
Jun 26 11:22:49 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0
Jun 26 11:22:49 my_host kernel: mptbase: ioc0: volume is now degraded, enabled, resync in progress

Jun 26 12:46:34 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0
Jun 26 12:46:34 my_host kernel: mptbase: ioc0: PhysDisk is now online
Jun 26 12:46:34 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0
Jun 26 12:46:34 my_host kernel: mptbase: ioc0: volume is now optimal, enabled, resync in progress
Jun 26 12:46:34 my_host kernel: mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0
Jun 26 12:46:34 my_host kernel: mptbase: ioc0: volume is now optimal, enabled



Para instalarlo solo hay que descargarse el rpm de http://rpmfind.net/linux/rpm2html/search.php?query=mpt-status y ejecutar

rpm -i -v mpt-status-1.2.0-72.i586.rpm

Una vez tenemos el paquete hay que:
  1. Crear el dispositivo /dev/mpctl, cargando el modulo en el kernel (#modprobe mptctl)
  2. Añadir "install mptctl" en "/etc/modprobe.conf.local" para que se cargue el módulo al iniciar.

Para ver en que estado nuestro raid, solo hay ejecutar mpt-status -s y si todo va bien, nos saldrá:

my_host:/ # mpt-status -s

log_id 0 OPTIMAL

phys_id 1 ONLINE

phys_id 0 ONLINE

En caso contrario, en /var/log/messages encontraremos log sobre lo que nos está sucediendo o bien haciendo una query al raid mediante mpt-status.

No hay comentarios: