Differences between revisions 4 and 5
Revision 4 as of 2010-07-26 17:05:30
Size: 916
Editor: SamatJain
Comment: Write-intent bitmaps
Revision 5 as of 2011-11-07 08:56:57
Size: 1729
Editor: SamatJain
Comment: Add info about recovering inactive arrays
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

<<TableOfContents>>
Line 31: Line 33:
{{{#!highlight sh {{{#!highlight sh numbers=off
Line 34: Line 36:

== Recovery ==

=== Inactive array ===

If an array comes out as inactive, e.g.:

{{{
md8 : inactive sdp1[0](S) sds1[4](S) sdx1[2](S) sdj1[1](S)
      7814054094 blocks super 1.2
}}}

Stop the array before we continue to work on it.

{{{#!highlight sh numbers=off
mdadm --stop /dev/md8
}}}

First, use examine the array components and figure out which component is out of sync (it's best to do this manually). Then, with the remaining components, reassemble the array. E.g. if /dev/sds1 was the bad device:

{{{#!highlight sh numbers=off
mdadm --assemble /dev/md8 /dev/sd[pxj]1 --force
}}}

to restart the array. If supposedly bad device is fine, go ahead and re-add it:

{{{#!highlight sh numbers=off
mdadm --manage /dev/md8 --add /dev/sds1
}}}

Creation

   1 # RAID 5 array creation
   2 sudo mdadm --create /dev/md5 --level=5 --raid-devices=3 /dev/sd[def]1
   3 
   4 # Create a high-performance RAID10 array (2x read speed compared to RAID1)
   5 sudo mdadm --create /dev/md6 --level=10 -p f2 --raid-devices=2 /dev/sd[ik]1

Write-intent bitmaps

Write-intent bitmaps speed-up RAID resyncs significantly, at the expense of a little write performance.

   1 # Create write-intent bitmap
   2 mdadm --grow --bitmap=internal /dev/mdX
   3 
   4 # Remove write-intent bitmap
   5 mdadm --grow --bitmap=none /dev/mdX

Diagnosis

Examine array component

Displays superblock information, including last event, RAID UUID, other components, etc.

mdadm --examine /dev/sda1

Recovery

Inactive array

If an array comes out as inactive, e.g.:

md8 : inactive sdp1[0](S) sds1[4](S) sdx1[2](S) sdj1[1](S)
      7814054094 blocks super 1.2

Stop the array before we continue to work on it.

mdadm --stop /dev/md8

First, use examine the array components and figure out which component is out of sync (it's best to do this manually). Then, with the remaining components, reassemble the array. E.g. if /dev/sds1 was the bad device:

mdadm --assemble /dev/md8 /dev/sd[pxj]1 --force

to restart the array. If supposedly bad device is fine, go ahead and re-add it:

mdadm --manage /dev/md8 --add /dev/sds1


CategoryCheatSheet

SamatsWiki: CheatSheet/LinuxSoftwareRAID (last edited 2021-11-01 21:59:06 by SamatJain)