Line 74: |
Line 74: |
| You can refer to 'man mdadm' or http://www.linuxmanpages.com/man8/mdadm.8.php | | You can refer to 'man mdadm' or http://www.linuxmanpages.com/man8/mdadm.8.php |
| | | |
− | Sometimes a partition will be taken offline automatically. This will happen if, for example, a read or write error is detected in a disk in the RAID set, or a disk does not respond fast enough, causing a timeout. When this happens, the details of the raid can be seen by inspecting the mdstat file. In the following example, partition hda2 (hard disk 'a', partition 2) is offline: | + | Sometimes a partition will be taken offline automatically. Admin will receive an email '''DegradedArray event on /dev/md2'''. |
| + | |
| + | This will happen if, for example, a read or write error is detected in a disk in the RAID set, or a disk does not respond fast enough, causing a timeout. When this happens, the details of the raid can be seen by inspecting the mdstat file. |
| | | |
| [root@sme]# cat /proc/mdstat | | [root@sme]# cat /proc/mdstat |
Line 81: |
Line 83: |
| 38837056 blocks [2/2] [UU] | | 38837056 blocks [2/2] [UU] |
| | | |
− | md2 : active raid1 hdb2[1] | + | md2 : active raid1 hdb2[1] <-- missing partition |
− | 1048704 blocks [2/1] [_U] | + | 1048704 blocks [2/1] [_U] <-- failed |
| | | |
| md0 : active raid1 hda1[0] hdb1[1] | | md0 : active raid1 hda1[0] hdb1[1] |
| 255936 blocks [2/2] [UU] | | 255936 blocks [2/2] [UU] |
| | | |
− | For more detail:
| + | Make a note of the raid partition that has failed, shown by '''[_U]''' <br> |
− | [root@sme ~]# mdadm --detail /dev/md2
| + | In this case it is md2, the device being /dev/md2. |
| | | |
− | To recover this raid, i.e. to get it back into sync, you need to use the 'mdadm --add' command.
| + | Determine the missing physical partition, Look carefully, and fill in the gap, <br> |
− | | + | in this example, it's hda2, the device being /dev/hda2 |
− | Make a note of the raid partition that has failed. In this case it is md2, the device being /dev/md2/. You will need to add the physical partition back into that raid partition. The missing physical partition in the above example is /dev/hda2
| + | md1 : active raid1 hda3[0] hdb3[1] |
| + | md2 : active raid1 '''hda2[0]''' hdb2[1] |
| + | md0 : active raid1 hda1[0] hdb1[1] |
| | | |
− | The command to run to re-add is then:
| + | To add the physical partition back into that raid partition. |
| | | |
| [root@sme]# mdadm --add /dev/md2 /dev/hda2 | | [root@sme]# mdadm --add /dev/md2 /dev/hda2 |