Making a corrupt RAID drive readable: Difference between revisions

>Samthecrazyman
Article started, not finished yet
 
>Samthecrazyman
m Added more, formatting number list needs sorting
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
== Attempt to repair and mount a damaged drive from a RAID array ==
== Attempt to repair and mount a damaged drive from a RAID array ==


# If you RAID drive is still mounted (which it shouln't be if it thinks it's corrupt!), unmount the drive as soon as possible. This will stop data becoming more inconsistent than it currently is. In a console, type <code>umount /dev/md#</code>, # being a number under which the array is mounted. If you only have 1 array mounted, popular defaults include <code>/dev/md0</code> and <code>/dev/md127</code>. Once this step is complete, nothing else can be changed on the drives. No harm in checking by running this step!
# If you RAID drive is still mounted (which it shouldn't be if it thinks it's corrupt!), unmount the drive as soon as possible. This will stop data becoming more inconsistent than it currently is. In a console, type <code>umount /dev/md#</code>, # being a number under which the array is mounted. If you only have 1 array mounted, popular defaults include <code>/dev/md0</code> and <code>/dev/md127</code>. Once this step is complete, nothing else can be changed on the drives. No harm in checking by running this step!
# Check the array and see what drives are still a part of the array. In a console, type <code>cat /proc/mdstat</code>. This shows the status of all active software RAID arrays. You should see something similar to the following:
# Check the array and see what drives are still a part of the array. In a console, type <code>cat /proc/mdstat</code>. This shows the status of all active software RAID arrays. You should see something similar to the following:  
  md0: active raid1 sda1[0] sdb1[1]<br>####### blocks [1/2] [_U]
#: <pre>md0: active raid1 sda1[0] sdb1[1]</pre>
#: <pre>976760696 blocks super 1.0 [1/2] [_U]</pre>
#: <pre>bitmap: 3/8 pages [12KB], 65536KB chunk</pre>
# In brackets, you will see either <code>[_U]</code> or <code>[U_]</code>. This shows a drive has failed as it should be <code>[UU]</code>. Looking at the top where it says the drive names, these are the order of the drives in the array, so if it shows <code>[_U]</code>, <code>sda1</code> has failed.


for guideance later: fsck.ext4 /dev/sda'''1'''
 
for guidance later: fsck.ext4 /dev/sda'''1''' -y
 
helpful source: http://linuxfanboy.com/index.php/Linux_Software_RAID see screenshots