RE: replace one disk in isw RAID1 array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Dear Hanson

I could see your problem is generated by a exchange of disk. When you install the new disk and the raid-card make the raid, it generate a new number of fake raid, completely different to the ancient number. 

I have had that problem and I solved it bootloading the server with a "tools distribution-disk" like the fantastic (at last for me) systemrescuecd with the option "dodmraid" at prompt boot. When the distribuition has loaded the server, already I could type all the differents orders of dmraid system like "dmraid -s". So I could see the new number of fakeraid. This number is too important to write it because you have to decompress the initrd of your server, looking for the old fake-raid number and exchange it.

As you can see, the problem you have, was caused by the initrd since it was wrote inside the number of the fakeraid. This number is written when you install the server.

I have a script to resolve this problem in the IBM Xservers 205. I send you a copy to help you about this question. This scripts has to run  on the systemrescuecd (of another system-tools distribution).

You may need to change the file /etc /fstab, but I'm not sure. In my case if I change it because I also use logical volumes.

I hope I have helped in solving the problem and excuse for my bad english.



################################################################################
#                                                                              #
# Script que genera un nuevo initrd para los servidores IBM xSeries 205        #
# necesario cada vez que se regenera el RAID asi como en el proceso de         #
# instalacion                                                                  #
#                                                                              #
# Madrid 13 de Marzo de 2009                                                   #
# Luis Martin Diaz                                                             #
#                                                                              #
#                                                                              #
# Madrid 16 de Octubre de 2009                                                 #
# Luis Martin Diaz                                                             #
#                                                                              #
# Hay que modificar tambien el archivo /etc/fstab de los IBMs pues no se puede #
# dejar el original que monta en /boot el disco cuya etiqueta sea LABEL=/boot  #
# ya que tendriamos tres dispositivos con el mismo nombre.                     #
#                                                                              #
################################################################################

# Lo primero a realizar es comprobar la maquina.
# Solamente ha de ejecutarse en las IBMs

VAR_MACH=`dmidecode | grep -i vendor | awk '{ print $2 }'`
if [ $VAR_MACH != "IBM"  -a $VAR_MACH != "ibm" ]
        then exit 0
fi

# Definamos las variables

VAR_NUEVO=`dmraid -r | egrep -m1 -o "lsi_[0-9a-zA-z]*"`

# Montemos la particion /dev/dm-1 y copiemos el initrd a /tmp/initrd

mkdir -p /tmp/initrd
mount /dev/dm-1 /mnt/custom
cp -af /mnt/custom/initrd*img /tmp/initrd/
cd /tmp/initrd
VAR_NOMBRE=`ls --color=none`
echo $VAR_NOMBRE
/bin/gzip -cd /tmp/initrd/initrd*img | /bin/cpio -idm 
rm -f /tmp/initrd/initrd*img

# Mas variables

VAR_VIEJO=`egrep -m 1 -o "lsi_[0-9a-zA-Z]*" /tmp/initrd/init`

# Comprobando dichas variables, podremos saber si se ha reconstruido el RAID

if [ $VAR_VIEJO == $VAR_NUEVO ]
        then exit 0
fi

echo "sed -e 's/$VAR_VIEJO/$VAR_NUEVO/g' init > init_nuevo" | sh

install -m 700 -o root -g root  /tmp/initrd/init_nuevo /tmp/initrd/init
rm -f /tmp/initrd/init_nuevo
find . | cpio -H newc -o | gzip -9 > /tmp/${VAR_NOMBRE}
install -m600 -o root -g root -b -S "_OLD" /tmp/${VAR_NOMBRE} /mnt/custom/ 
umount -f /mnt/custom

# Ahora vamos a modificar el archivo /etc/fstab
# En este punto el script servidores ha modificado dicho archivo por lo que 
# solamente nos vamos a encontrar ficheros fstab de IBM
# Hemos de ver si la particion del tipo lsi_xxxxxxxxxxp1 es la correcta.o

mount | grep vol-ROOT || mount /dev/vol/ROOT /mnt/custom
VAR_VIEJOP1=$(grep -o "lsi_[a-zA-Z0-9]*" /mnt/custom/etc/fstab)
if [ ${VAR_VIEJOP1} != ${VAR_NUEVO}p1 ]
then
        echo "'s/${VAR_VIEJOP1}/${VAR_NUEVO}p1/g' /mnt/custom/etc/fstab" \
                | xargs sed -e > /mnt/custom/etc/fstab_NEW
        install -m 644 -o root -g root -b -S ".old" \
                /mnt/custom/etc/fstab_NEW /mnt/custom/etc/fstab
fi
umount /mnt/custom

# En este punto hemos de ver si ha de rebotarse el servidor o no segun el
# criterio de si se trata de una reparacion de RAID (por cambio de disco)
# que en este caso es rebotaria. O, por el contrario, se trate de una nueva
# instalacion y por lo tanto, no debe ser reiniciado pues ha de volver el 
# control al script autorun del master.
# 
# El criterio que se sigue para ello es la manera de invocar el presente script.
# pues si se lleva a cabo pasandole un parametro (concretamente la palabra IBM)
# entonces es una nueva instalacion. Si no se impone ningun parametro, estamos
# con una reparacion.

if [ $# -ne 0 ]
then
        exit 0
else
# Insertamos un dialogo que nos diga si ha habido un error o si va a rebotar
        /usr/bin/dialog --title "Aviso" --msgbox "El dispositivo RAID se ha actu
alizado correctamente\nSe va a reiniciar el sistema en unos segundos" 0 0
        sleep 3
fi
/sbin/reboot
exit 0




-----Mensaje original-----
De: ataraid-list-bounces@xxxxxxxxxx [mailto:ataraid-list-bounces@xxxxxxxxxx] En nombre de Aaron Hanson
Enviado el: miércoles, 01 de diciembre de 2010 0:55
Para: ATARAID (eg, Promise Fasttrak, Highpoint 370) related discussions
Asunto: RE: replace one disk in isw RAID1 array

Oops; forgot the most important command, where I try to initiate a rebuild with the new disk:

bash (try 'info') lib > dmraid -dR isw_bdidaifdia_Raid1 /dev/sdb
DEBUG: _find_set: searching isw_bdidaifdia
DEBUG: _find_set: not found isw_bdidaifdia
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: not found isw_bdidaifdia_Raid1
DEBUG: _find_set: not found isw_bdidaifdia_Raid1
ERROR: isw: wrong number of devices in RAID set "isw_bdidaifdia_Raid1" [1/2] on /dev/sda
DEBUG: set status of set "isw_bdidaifdia_Raid1" to 4
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: searching isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
DEBUG: _find_set: found isw_bdidaifdia_Raid1
ERROR: isw: only one failed disk supported
metadata fmt update failed

DEBUG: rebuild: raid "isw_bdidaifdia_Raid1" rebuild finished

DEBUG: freeing devices of RAID set "isw_bdidaifdia_Raid1"
DEBUG: freeing device "isw_bdidaifdia_Raid1", path "/dev/sda"
DEBUG: freeing device "(null)", path "/dev/sdb"
DEBUG: freeing devices of RAID set "isw_bdidaifdia"
DEBUG: freeing device "isw_bdidaifdia", path "/dev/sda"
DEBUG: freeing device "(null)", path "/dev/sdb"

> -----Original Message-----
> From: ataraid-list-bounces@xxxxxxxxxx [mailto:ataraid-list-
> bounces@xxxxxxxxxx] On Behalf Of Aaron Hanson
> Sent: Tuesday, November 30, 2010 3:49 PM
> To: ataraid-list@xxxxxxxxxx
> Subject: replace one disk in isw RAID1 array
> 
> Hi All -
> 
> This seems like it should be a very common procedure.  I've researched this a
> lot before bothering this list, I hope someone can comment. In short:
> 
> -- I've created a mirror with 2 disks; it works fine.
> -- I shut the system down, remove one disk and replace it with a blank disk.
> -- Power up; array state is inconsistent.
> -- New disk is 'sdb'.  I want to use 'dmraid' to rebuild the array with the new
> disk, but I get errors. The most significant error seems to be:
>     "ERROR: isw: only one failed disk supported"
> -- 'dmraid ' continues to report that there is only one device in the set; the
> request to rebuild with a new drive has clearly failed.
> 
> The complete steps with additional version information and output is below.
> Thanks in advance for any suggestions.  I would really appreciate references
> to some tutorials with more 'dmraid' examples than shown in the man page
> too, if such a thing exists.
> 
> 
> -Aaron
> 
> bash (try 'info') lib > uname -a
> Linux localhost 2.6.18-194.26.1.el5.1.0.f5app #1 SMP Fri Nov 19 19:38:18 PST
> 2010 x86_64 x86_64 x86_64 GNU/Linux
> bash (try 'info') lib > dmraid --version
> dmraid version:		1.0.0.rc16-3 (2010.11.12)
> dmraid library version:	1.0.0.rc16-3 (2010.11.12)
> device-mapper version:	4.11.5
> bash (try 'info') lib > dmraid -s
> ERROR: isw: wrong number of devices in RAID set "isw_bdidaifdia_Raid1"
> [1/2] on /dev/sda
> *** Group superset isw_bdidaifdia
> --> *Inconsistent* Active Subset
> name   : isw_bdidaifdia_Raid1
> size   : 586062848
> stride : 128
> type   : mirror
> status : inconsistent
> subsets: 0
> devs   : 1
> spares : 0
> bash (try 'info') lib > dmraid -r
> /dev/sda: isw, "isw_bdidaifdia", GROUP, ok, 586072366 sectors, data@ 0
> bash (try 'info') lib > dmraid -dR isw_bdidaifdia_Raid1 /dev/sdb
> DEBUG: _find_set: searching isw_bdidaifdia
> DEBUG: _find_set: not found isw_bdidaifdia
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: not found isw_bdidaifdia_Raid1
> DEBUG: _find_set: not found isw_bdidaifdia_Raid1
> ERROR: isw: wrong number of devices in RAID set "isw_bdidaifdia_Raid1"
> [1/2] on /dev/sda
> DEBUG: set status of set "isw_bdidaifdia_Raid1" to 4
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: searching isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> DEBUG: _find_set: found isw_bdidaifdia_Raid1
> ERROR: isw: only one failed disk supported metadata fmt update failed
> 
> DEBUG: rebuild: raid "isw_bdidaifdia_Raid1" rebuild finished
> 
> DEBUG: freeing devices of RAID set "isw_bdidaifdia_Raid1"
> DEBUG: freeing device "isw_bdidaifdia_Raid1", path "/dev/sda"
> DEBUG: freeing device "(null)", path "/dev/sdb"
> DEBUG: freeing devices of RAID set "isw_bdidaifdia"
> DEBUG: freeing device "isw_bdidaifdia", path "/dev/sda"
> DEBUG: freeing device "(null)", path "/dev/sdb"
> bash (try 'info') lib > dmraid -s
> ERROR: isw: wrong number of devices in RAID set "isw_bdidaifdia_Raid1"
> [1/2] on /dev/sda
> *** Group superset isw_bdidaifdia
> --> *Inconsistent* Active Subset
> name   : isw_bdidaifdia_Raid1
> size   : 586062848
> stride : 128
> type   : mirror
> status : inconsistent
> subsets: 0
> devs   : 1
> spares : 0
> 
> 
> 
> 
> 
> _______________________________________________
> Ataraid-list mailing list
> Ataraid-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/ataraid-list

_______________________________________________
Ataraid-list mailing list
Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list

_______________________________________________
Ataraid-list mailing list
Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list



[Linux RAID]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Photos]     [Yosemite Photos]     [Yosemite News]     [AMD 64]
  Powered by Linux