Cleaning a RAID1 array. Help!

Hi,
I have (not sure how - but that’s another issue) a RAID1 array with three members!

myNewRouter:~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]                                             
md0 : active raid1 sdc1[3] sdb1[2]                                                                           
      312567616 blocks super 1.0 [3/2] [U_U]                                                                 
      bitmap: 3/3 pages [12KB], 65536KB chunk 

I can see (from the the [U_U] string) that one of the three is missing. So to get more information, I try:

myNewRouter:~ # mdadm -v --misc --detail /dev/md0                                                  
/dev/md0:                                                                                                    
        Version : 1.0                                                                                        
  Creation Time : Thu Sep 11 22:37:46 2014                                                                   
     Raid Level : raid1                                                                                      
     Array Size : 312567616 (298.09 GiB 320.07 GB)                                                           
  Used Dev Size : 312567616 (298.09 GiB 320.07 GB)                                                           
   Raid Devices : 3                                                                                          
  Total Devices : 2                                                                                          
    Persistence : Superblock is persistent                                                                   
                                                                                                             
  Intent Bitmap : Internal                                                                                   
                                                                                                             
    Update Time : Tue Oct 14 21:34:41 2014                                                                   
          State : active, degraded                                                                           
 Active Devices : 2                                                                                          
Working Devices : 2                                                                                          
 Failed Devices : 0                                                                                          
  Spare Devices : 0                                                                                          
                                                                                                             
           Name : myNewRouter:0  (local to host myNewRouter)                                                 
           UUID : 3aabb2b5:da293f81:af380ffc:ceb58188                                                        
         Events : 18875

    Number   Major   Minor   RaidDevice State
       3       8       33        0      active sync   /dev/sdc1
       2       0        0        2      removed
       2       8       17        2      active sync   /dev/sdb1

From this report, I can see confirmation that MDADM thinks that it is a RAID1 with 3 members and that the last section gives (I think) information on the missing (removed?) member.

I have tried:

myNewRouter:~ # mdadm /dev/md0 -r detached

With no luck.

Can anyone suggest a command/strategy to clean-up this array so that it is not reporting as “Degraded”?

Best regards, Martin

HI all,

Just to answer my own question, I think that –GROW (or in my case to shrink!) is the solution. Thus:

mdadm --grow --raid-devices=2 /dev/md0

I now get:

myNewRouter:~ # mdadm -v --misc --detail /dev/md0
/dev/md0:
        Version : 1.0
  Creation Time : Thu Sep 11 22:37:46 2014
     Raid Level : raid1
     Array Size : 312567616 (298.09 GiB 320.07 GB)
  Used Dev Size : 312567616 (298.09 GiB 320.07 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Wed Oct 15 14:05:31 2014
          State : active 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : myNewRouter:0  (local to host myNewRouter)
           UUID : 3aabb2b5:da293f81:af380ffc:ceb58188
         Events : 33753

    Number   Major   Minor   RaidDevice State
       3       8       33        0      active sync   /dev/sdc1
       2       8       17        1      active sync   /dev/sdb1
myNewRouter:~ #

Yippie…:slight_smile: