Changes

From SME Server
Jump to navigationJump to search
18 bytes added ,  05:33, 27 October 2007
→‎Resynchronising a Failed RAID: replace hotraid with --add
Line 72: Line 72:  
====Resynchronising a Failed RAID====
 
====Resynchronising a Failed RAID====
   −
See http://www.linuxmanpages.com/man8/mdadm.8.php#lbAP
+
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. 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:
   −
<pre>[root@sme]# cat /proc/mdstat
+
[root@sme]# cat /proc/mdstat
Personalities : [raid1]
+
Personalities : [raid1]
md1 : active raid1 hda3[0] hdb3[1]
+
md1 : active raid1 hda3[0] hdb3[1]
 
       38837056 blocks [2/2] [UU]
 
       38837056 blocks [2/2] [UU]
 
+
md2 : active raid1 hdb2[1]
+
md2 : active raid1 hdb2[1]
 
       1048704 blocks [2/1] [_U]
 
       1048704 blocks [2/1] [_U]
 
+
md0 : active raid1 hda1[0] hdb1[1]
+
md0 : active raid1 hda1[0] hdb1[1]
       255936 blocks [2/2] [UU]</pre>
+
       255936 blocks [2/2] [UU]
    
To recover this raid, i.e. to get it back into sync, you need to use the raidhotadd command.
 
To recover this raid, i.e. to get it back into sync, you need to use the raidhotadd command.
Line 93: Line 93:  
The command to run is then:
 
The command to run is then:
   −
<pre>raidhotadd /dev/md2 /dev/hda2</pre>
+
[root@sme]# mdadm --add /dev/md2 /dev/hda2
 
+
 
Your devices are likely to be different, and you may have more than two disks, including a hot standby, but will always be determined from the mdstat file. Once the raid resync has been started, the progress will be noted in mtstat, for example:
 
Your devices are likely to be different, and you may have more than two disks, including a hot standby, but will always be determined from the mdstat file. Once the raid resync has been started, the progress will be noted in mtstat, for example:
   −
<pre>[root@sme]# cat /proc/mdstat
+
[root@sme]# cat /proc/mdstat
Personalities : [raid1]
+
Personalities : [raid1]
md1 : active raid1 hda3[0] hdb3[1]
+
md1 : active raid1 hda3[0] hdb3[1]
      38837056 blocks [2/2] [UU]
+
      38837056 blocks [2/2] [UU]
 
+
md2 : active raid1 hda2[2] hdb2[1]
+
md2 : active raid1 hda2[2] hdb2[1]
      1048704 blocks [2/1] [_U]
+
      1048704 blocks [2/1] [_U]
      [=>...................]  recovery =  6.4% (67712/1048704) finish=1.2min speed=13542K/sec
+
      [=>...................]  recovery =  6.4% (67712/1048704) finish=1.2min speed=13542K/sec
md0 : active raid1 hda1[0] hdb1[1]
+
md0 : active raid1 hda1[0] hdb1[1]
      255936 blocks [2/2] [UU]
+
      255936 blocks [2/2] [UU]
</pre>
      
When recovery is complete, the partitions will all be up:
 
When recovery is complete, the partitions will all be up:
   −
<pre>[root@sme]# cat /proc/mdstat
+
[root@sme]# cat /proc/mdstat
Personalities : [raid1]
+
Personalities : [raid1]
md1 : active raid1 hda3[0] hdb3[1]
+
md1 : active raid1 hda3[0] hdb3[1]
      38837056 blocks [2/2] [UU]
+
      38837056 blocks [2/2] [UU]
 
+
md2 : active raid1 hda2[0] hdb2[1]
+
md2 : active raid1 hda2[0] hdb2[1]
 
       1048704 blocks [2/2] [UU]
 
       1048704 blocks [2/2] [UU]
 
+
md0 : active raid1 hda1[0] hdb1[1]
+
md0 : active raid1 hda1[0] hdb1[1]
      255936 blocks [2/2] [UU]
+
      255936 blocks [2/2] [UU]
</pre>
      
If this action is required regularly, you should test your disks for SMART errors and physical errors, check your disk cables, and make sure no two hard drives share the same IDE port. Also check your driver cards, since a faulty card can destroy the data on a full RAID set as easily as it can a single disk.
 
If this action is required regularly, you should test your disks for SMART errors and physical errors, check your disk cables, and make sure no two hard drives share the same IDE port. Also check your driver cards, since a faulty card can destroy the data on a full RAID set as easily as it can a single disk.
    
<noinclude>[[Category:Howto]]</noinclude>
 
<noinclude>[[Category:Howto]]</noinclude>

Navigation menu