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/2] [UU] 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>Podemos acrescentar um novo disco para ficar de reserva com o comando abaixo. # mdadm --manage /dev/md1 --add /dev/sdgmdadm: added /dev/sdgAgora vamos verificar o arquivo /proc/mdstat # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdg[2](S) sdc[1] sdb[0] 2096116 blocks super 1.2 [2/2] [UU] md5 : active raid5 sdd[0] sdf[3] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Como pode ser notado em md1 temos o sdg que esta com (S) que e de spare-disk nosso disco reserva entao caso o algum dos dois disco apresente problema ele assume automaticamente, vamos fazer um teste. Vamos fazer dar falha em um disco # mdadm --fail /dev/md1 /dev/sdcmdadm: set /dev/sdc faulty in /dev/md1Vamos acompanhar o nosso raid # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdg[2] sdc[1](F) sdb[0] 2096116 blocks super 1.2 [2/1] [_U] [==========>................] recovery = 21.8% (457984/2096116) finish=0.1min speed=228992K/sec md5 : active raid5 sdd[0] sdf[3] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Como pode ser notado o /dev/sdg vai assumir por causa que o sdc esta com (F) de fail.Agora vamos obter dados do nosso raid # mdadm --detail --scan ARRAY /dev/md/5 metadata=1.2 name=debian22:5 UUID=0e31bb76:46b38d02:cc02b1bc:7248912fARRAY /dev/md/1 metadata=1.2 name=debian22:1 UUID=d54a7d1b:9f419df5:25251005:2ad3a668Agora vamos obter informacoes sobre o nosso /dev/md1 # mdadm --detail /dev/md1 /dev/md1: Version : 1.2 Creation Time : Tue Aug 9 09:30:58 2011 Raid Level : raid1 Array Size : 2096116 (2047.33 MiB 2146.42 MB) Used Dev Size : 2096116 (2047.33 MiB 2146.42 MB) Raid Devices : 2 Total Devices : 3 Persistence : Superblock is persistent Update Time : Tue Aug 9 10:46:37 2011 State : clean Active Devices : 2Working Devices : 2 Failed Devices : 1 Spare Devices : 0 Name : debian22:1 (local to host debian22) UUID : d54a7d1b:9f419df5:25251005:2ad3a668 Events : 226 Number Major Minor RaidDevice State 2 8 96 0 active sync /dev/sdg 0 8 16 1 active sync /dev/sdb 1 8 32 - faulty spare /dev/sdcAgora vamos ver como que paramos um raid # mdadm --stop /dev/md1mdadm: stopped /dev/md1Agora ele nem esta mais aparecendo no /proc/mdstat # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md5 : active raid5 sdd[0] sdf[3] sde[1] 4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none>Agora vamos ver como subimos ele novamente # mdadm -A /dev/md1 --run /dev/{sdb,sdc}Agora temos que habilitar o raid nao trabalhar somente em read-only # mdadm -w /dev/md1Agora vamos adicionar o nosso hd extra # mdadm --manage /dev/md1 --add /dev/sdcmdadm: re-added /dev/sdcVamos verificar novamente o nosso raid # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]md1 : active raid1 sdc[1](S) sdg[2] sdb[0] 2096116 blocks super 1.2 [2/2] [UU] md5 : active