daemon where to send mail alertsMAILADDR root # definitions of existing MD arrays # This file was auto-generated on Tue, 09 Aug 2011 09:29:33 -0300# by mkconf 3.1.4-1+8efb9d1ARRAY /dev/md/1 metadata=1.2 UUID=d54a7d1b:9f419df5:25251005:2ad3a668 name=debian22:1ARRAY /dev/md/5 metadata=1.2 UUID=0e31bb76:46b38d02:cc02b1bc:7248912f name=debian22:5Agora vamos tirar a identificacao das particoes # blkid /dev/sda1: UUID="b76bd2ef-b659-45d5-9fad-5bb15cd33040" TYPE="ext3"/dev/sda5: UUID="e3bc4b38-68e0-48f5-8c91-741dc110ae45" TYPE="ext3"/dev/sda6: UUID="275b073b-0b12-4781-98f3-26c87caee7dc" TYPE="ext3"/dev/sda7: UUID="fb553dc0-5927-4ea4-8885-c9be8b0468d4" TYPE="swap"/dev/sda8: UUID="3cf18df1-e31c-4fdf-a267-d8d4256b6ba2" TYPE="ext3"/dev/sda9: UUID="ef9c85da-d5b3-4ddf-973a-4527f121d97d" TYPE="ext3"/dev/sdb: UUID="d54a7d1b-9f41-9df5-2525-10052ad3a668" LABEL="debian22:1" TYPE="linux_raid_member"/dev/sdc: UUID="d54a7d1b-9f41-9df5-2525-10052ad3a668" LABEL="debian22:1" TYPE="linux_raid_member"/dev/md1: UUID="647d1da8-0f99-48c5-bbea-ab30595cfe76" TYPE="ext3"/dev/sdd: UUID="0e31bb76-46b3-8d02-cc02-b1bc7248912f" LABEL="debian22:5" TYPE="linux_raid_member"/dev/sde: UUID="0e31bb76-46b3-8d02-cc02-b1bc7248912f" LABEL="debian22:5" TYPE="linux_raid_member"/dev/md5: UUID="1316b782-58e9-486e-b97e-75882a5a1807" TYPE="ext3"/dev/sdf: UUID="0e31bb76-46b3-8d02-cc02-b1bc7248912f" LABEL="debian22:5" TYPE="linux_raid_member"Nos precisamos da identificacao do /dev/md1 e do /dev/md5 para colocarmos o nosso raid na inicializacao.O nosso arquivo do /etc/fstab tem que ficar parecido com o abaixo # cat /etc/fstab # /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass>proc /proc proc defaults 0 0# / was on /dev/sda1 during installationUUID=b76bd2ef-b659-45d5-9fad-5bb15cd33040 / ext3 errors=remount-ro 0 1# /home was on /dev/sda9 during installationUUID=ef9c85da-d5b3-4ddf-973a-4527f121d97d /home ext3 defaults 0 2# /tmp was on /dev/sda8 during installationUUID=3cf18df1-e31c-4fdf-a267-d8d4256b6ba2 /tmp ext3 defaults 0 2# /usr was on /dev/sda5 during installationUUID=e3bc4b38-68e0-48f5-8c91-741dc110ae45 /usr ext3 defaults 0 2# /var was on /dev/sda6 during installationUUID=275b073b-0b12-4781-98f3-26c87caee7dc /var ext3 defaults 0 2# swap was on /dev/sda7 during installationUUID=fb553dc0-5927-4ea4-8885-c9be8b0468d4 none swap sw 0 0/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0UUID="647d1da8-0f99-48c5-bbea-ab30595cfe76" /mnt/raid1 ext3 defaults 0 0UUID="1316b782-58e9-486e-b97e-75882a5a1807" /mnt/raid5 ext3 defaults 0 0Agora vamos ver como testamos o nosso raid vamos dar falha em um dispositivo do nosso raid # mdadm --fail /dev/md1 /dev/sdc# mdadm: set /dev/sdc faulty in /dev/md1Vamos analisar o arquivo /proc/mdstat pode ser notado que em md1 temos um [_U] que significa que o sdc esta falho # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdc[1](F) sdb[0] 2096116 blocks super 1.2 [2/1] [_U] md5 : active raid5 sdf[3] sdd[0] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Agora vamos ver como fazemos para remover o dispositivo do array que esta com problema # mdadm --remove /dev/md1 /dev/sdc# mdadm: hot removed /dev/sdc from /dev/md1Como pode ser notado em /proc/mdstat temos somente um sdb em md1 ou seja estamos sem um disco agora vamos ver para adicionar ele novamente. # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdb[0] 2096116 blocks super 1.2 [2/1] [_U] md5 : active raid5 sdf[3] sdd[0] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Adicionando o novo disco # mdadm --add /dev/md1 /dev/sdc# mdadm: re-added /dev/sdcAgora vamos acompanhar os logs # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdc[1] sdb[0] 2096116 blocks super 1.2 [2/1] [_U] [================>.............] recovery = 38.5% (809408/2096116) finish=0.1min speed=202352K/sec md5 : active raid5 sdf[3] sdd[0] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Como pode ser notado o array esta sincronizando. Assim que terminar o array vamos ficar assim #