Need help in recovering from disk failure using mdadm
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need help in recovering from disk failure using mdadm
I have a Centos 6 based server with 4 1TB disks in RAID5. This morning one of the disks failed. I was successful in removing it from the RAID configuration, but I'm having trouble replacing it with the spare that I had on-hand (but not installed). To complicate matters, when I removed /dev/sdc (the failed disk) and installed the new disk, one of the remaining good drives moved to /dev/sdc and the newly installed drive came is as /dev/sdd. I've never done this before so I've probably made some mistakes already. I'm hoping someone with some good mdadm knowldege can help me.
I can't figure out how to "get the big picture" for this array from mdadm so ask if you need more info to help me.
Marc
You can "get the big picture" with 'mdadm -D /dev/mdX' where X is your array. This will tell you the state of the array and all component disks. That said, it's unusual for any disk to just change device assignment like that. Also, 3/4 of your device superblocks claim 2 out of 4 disks are missing; in a raid5 setup with one parity disk, that would be fatal.
So are you telling me that there is no way to recover from this state? Three of the 4 disks in the original array are still present. The array rebuilt after the disk failed and I thought it got to a good state. Is it possible to just reassemble the array from the 3 disks and then add the 4th in (a spare now)?
Here's the big picture:
[root@server ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.1
Creation Time : Wed Dec 28 09:14:59 2011
Raid Level : raid5
Array Size : 2930284032 (2794.54 GiB 3000.61 GB)
Used Dev Size : 976761344 (931.51 GiB 1000.20 GB)
Raid Devices : 4
Total Devices : 3
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Sat Mar 10 15:21:12 2012
State : active, FAILED
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Name : server:0 (local to host server)
UUID : df49e51e:9ef5c518:27d37da2:aa0aa661
Events : 9349
Number Major Minor RaidDevice State
0 8 0 0 active sync /dev/sda
1 8 16 1 active sync /dev/sdb
2 0 0 2 removed
3 0 0 3 removed
So are you telling me that there is no way to recover from this state? Three of the 4 disks in the original array are still present. The array rebuilt after the disk failed and I thought it got to a good state. Is it possible to just reassemble the array from the 3 disks and then add the 4th in (a spare now)?
A 4-disk raid5 array would not be able to rebuild on 3 disks, there would be no room for parity. The array would be marked as degraded. You may be able to re-add a "removed" disk (that did not fail) using mdadm --add / --re-add (see man mdadm). You will still need the 4th (spare) disk present for a full rebuild to a good state.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.