You are not logged in.

#1 2011-12-16 18:58:43

Dave Cohen
Member
Registered: 2008-09-27
Posts: 126

[SOLVED] raid1 array missing devices

My software raid1 array is in a funky state.  /proc/mdstat shows a mix of partitions from two drives...

[dave@starbuck ~]$ cat /proc/mdstat 
Personalities : [raid1] 
md3 : active raid1 sdb3[0]
      499998912 blocks [2/1] [U_]
      
md2 : active raid1 sdc2[1]
      4000064 blocks [2/1] [_U]
      
md1 : active raid1 sdb1[0]
      96256 blocks [2/1] [U_]
      
md0 : active raid1 sdb4[0]
      472664320 blocks [2/1] [U_]
      
unused devices: <none>

I've found multiple threads suggesting fixes for this, but my attempts do not work:

[dave@starbuck ~]$ sudo mdadm /dev/md0 -a /dev/sdc4
mdadm: /dev/sdc4 reports being an active member for /dev/md0, but a --re-add fails.
mdadm: not performing --add as that would convert /dev/sdc4 in to a spare.
mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sdc4" first.

Other mdadm commands report "no such device"!  What is that about?

[dave@starbuck ~]$ sudo mdadm /dev/md0 --fail /dev/sdc4
mdadm: set device faulty failed for /dev/sdc4:  No such device
[dave@starbuck ~]$ sudo mdadm /dev/md0 -r /dev/sdc4
mdadm: hot remove failed for /dev/sdc4: No such device or address

I'm not sure how long the array has been in trouble, or whether the partitions are actually faulty.  I'm not really sure what logs to look in, but I have found the following.  In particular I wonder if "kicking non-fresh sdb2 from array" is part of the problem.

[dave@starbuck ~]$ grep "md:" /var/log/everything.log
...snip...
Dec 16 02:23:55 localhost kernel: [    3.205757] md: raid1 personality registered for level 1
Dec 16 02:23:55 localhost kernel: [    3.752779] md: md0 stopped.
Dec 16 02:23:55 localhost kernel: [    3.757339] md: bind<sdb4>
Dec 16 02:23:55 localhost kernel: [    3.799662] md: md1 stopped.
Dec 16 02:23:55 localhost kernel: [    3.800661] md: bind<sdb1>
Dec 16 02:23:55 localhost kernel: [    3.814430] md: md2 stopped.
Dec 16 02:23:55 localhost kernel: [    3.815267] md: bind<sdb2>
Dec 16 02:23:55 localhost kernel: [    3.815482] md: bind<sdc2>
Dec 16 02:23:55 localhost kernel: [    3.815504] md: kicking non-fresh sdb2 from array!
Dec 16 02:23:55 localhost kernel: [    3.815509] md: unbind<sdb2>
Dec 16 02:23:55 localhost kernel: [    3.820073] md: export_rdev(sdb2)
Dec 16 02:23:55 localhost kernel: [    3.830995] md: md3 stopped.
Dec 16 02:23:55 localhost kernel: [    3.831908] md: bind<sdb3>
...snip...

Can anyone suggest what to try next?  Thanks for any pointers.

Last edited by Dave Cohen (2011-12-19 03:03:53)

Offline

#2 2011-12-17 13:50:02

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] raid1 array missing devices

Since it is RAID1, I would determine which disk contains the best information, and recreate your array using that data. I have no positive experiences trying to fix md funkyness wink

Offline

#3 2011-12-17 18:49:47

Dave Cohen
Member
Registered: 2008-09-27
Posts: 126

Re: [SOLVED] raid1 array missing devices

That answer makes sense.  I'm no expert with raid, I just wanted to make a disk failure on my desktop not catastrophic.  I don't even know what a "spare" means in this context.

If I'm able to rebuild an array, I'll post what I did here.

Offline

#4 2011-12-19 03:09:08

Dave Cohen
Member
Registered: 2008-09-27
Posts: 126

Re: [SOLVED] raid1 array missing devices

Without really understanding the "spare" concept, I tried the --zero-superblock option as suggested by mdadm, before the --add.  In other words, this...

[dave@starbuck misc]$ sudo mdadm --zero-superblock /dev/sdc1
[dave@starbuck misc]$ sudo mdadm /dev/md1 -a /dev/sdc1
mdadm: added /dev/sdc1

This starts the syncing process, which took a while on the large partitions, much less time on the smaller ones.

To my pleasant surprise, after the sync completed, mdadm made the "spare" into a regular part of the array.

So I repeated the process for all the incomplete arrays (I did one at a time, but it probably would have worked all at once) and now things are looking good:

[dave@starbuck misc]$ cat /proc/mdstat
Personalities : [raid1] 
md3 : active raid1 sdc3[1] sdb3[0]
      499998912 blocks [2/2] [UU]
      
md2 : active raid1 sdb2[0] sdc2[1]
      4000064 blocks [2/2] [UU]
      
md1 : active raid1 sdc1[1] sdb1[0]
      96256 blocks [2/2] [UU]
      
md0 : active raid1 sdc4[1] sdb4[0]
      472664320 blocks [2/2] [UU]
      
unused devices: <none>

Offline

Board footer

Powered by FluxBB