Skip to content

Instantly share code, notes, and snippets.

@mamrehn
Created November 8, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamrehn/42a10c6b5ebf8200b6e0 to your computer and use it in GitHub Desktop.
Save mamrehn/42a10c6b5ebf8200b6e0 to your computer and use it in GitHub Desktop.
Recover degraded array in a software raid.

Source: Based on an artice at thomas-krenn.com (german, english translation) and raid.wiki.kernel.org.

1. Get a new hdd of same or greater size

Use feature comparison websites like gh.de or pricegrabber.com to find a suitable device.

2. Substitute with drive causing the failure

Check which drive is causing the degradation.

mdadm --examine /dev/sd[a-z] | egrep 'Event|/dev/sd'
3. Check the raid's state before recovery
sudo mdadm -D /dev/md0

where md0 is the virtual block device of the raid. One line should read State : clean, degraded.

4. Add new hdd to the array
sudo mdadm --manage /dev/md0 -a /dev/sdx

where sdx is the new discrete block devices address. This may take approximately 4-7 hours for a 2TB device.

5. Check the raid's state after recovery
sudo mdadm -D /dev/md0

should now yield State : clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment