LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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



Reply
 
Search this Thread
Old 08-11-2010, 02:40 PM   #1
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 162

Rep: Reputation: 28
RAID5 disk failure during recovery gives weird result


First off, I know it's bad when you have a disk failure during recovery, but this is not exactly what I'm concerned about.

So I go ahead and create a RAID5 with sda1, sdb1, sdc1.
Code:
~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[3] sdb1[1] sda1[0]
      250067584 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
      [>....................]  recovery =  2.7% (3499520/125033792) finish=10.9min speed=184185K/sec

unused devices: <none>
Now during recovery(initialization) if I fail a drive I get strange results depending on the drive I fail(or maybe I'm just confused). If I fail sda1 using "mdadm /dev/md0 -f /dev/sda1", sda1 fails as expected, sdb1 is still apart of the RAID, and sdc1 turns into a spare for the RAID.
Code:
~ # mdadm /dev/md0 -f /dev/sda1
mdadm: set /dev/sda1 faulty in /dev/md0
~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[3](S) sdb1[1] sda1[4](F)
      250067584 blocks level 5, 64k chunk, algorithm 2 [3/1] [_U_]

unused devices: <none>
So why does sdc1 turn into a spare?

Same thing happens if I fail sdb1, but if I fail sdc1 I don't end up with a "spare" disk, both sda1 and sdb1 are still apart of the RAID.
Code:
 ~ # mdadm /dev/md0 -f /dev/sdc1
mdadm: set /dev/sdc1 faulty in /dev/md0
~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[3](F) sdb1[1] sda1[0]
      250067584 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
I would expect all case to behave they way it did when I fail sdc1. Should I really see different behavior depending on what disk I fail?
Could someone please explain this to me?
 
Old 08-12-2010, 11:07 AM   #2
LinuxBauer
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Rep: Reputation: 0
The disk that you fail should definitely have an effect on the behavior, but as to what extent is a mystery to me.
 
Old 08-13-2010, 12:16 PM   #3
dbrazeau
Member
 
Registered: Aug 2009
Distribution: Fedora, OpenSuse, DENX Embedded Linux
Posts: 162

Original Poster
Rep: Reputation: 28
To me it looks like the md driver actually treats the last partition listed in the RAID5 create command as a "spare" until the RAID is initialized, i.e. during recovery. In my case this would be the third drive sdc1. Therefore if I fail one of the other drives during recovery sdc1, which is currently being treated as the "spare", will return to being the "spare" since it can no longer continue the rebuild with one of the other drives being "failed".

The initialization process of the RAID5 is actually treated as any other rebuild with one of the disks in the RAID treated as the "spare" being rebuilt to by default.

Last edited by dbrazeau; 08-13-2010 at 12:18 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed RAID5 disk array, questions about mdadm and recovery HellesAngel Linux - General 13 04-08-2012 06:30 AM
RAID5 two disk failure, botched recovery, need help finding filesystem GregIthaca Linux - Server 2 06-15-2010 09:57 AM
How to monitor LaCie 4big Quadra RAID5 box for disk failure Vanyel Linux - Hardware 0 05-27-2010 05:12 PM
multiple disk failure in RAID5 and dd gorets Linux - Hardware 1 07-22-2005 02:51 PM
multiple disk failure in RAID5 and dd gorets Linux - Software 1 07-21-2005 10:25 AM


All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration