Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had to replace two hard drives in my RAID1. After adding the two new partitions the old ones are still showing up as removed while the new ones are only added as spare. I've had no luck removing the partitions marked as removed.

Here's the RAID in question. Note the two devices (0 and 1) with state removed.

$ mdadm --detail /dev/md1

mdadm: metadata format 00.90 unknown, ignored.
mdadm: metadata format 00.90 unknown, ignored.
/dev/md1:
        Version : 00.90
  Creation Time : Thu May 20 12:32:25 2010
     Raid Level : raid1
     Array Size : 1454645504 (1387.26 GiB 1489.56 GB)
  Used Dev Size : 1454645504 (1387.26 GiB 1489.56 GB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Tue Nov 12 21:30:39 2013
          State : clean, degraded
 Active Devices : 1
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 2

           UUID : 10d7d9be:a8a50b8e:788182fa:2238f1e4
         Events : 0.8717546

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       0        0        1      removed
       2       8       34        2      active sync   /dev/sdc2

       3       8       18        -      spare   /dev/sdb2
       4       8        2        -      spare   /dev/sda2

How do I get rid of these devices and add the new partitions as active RAID devices?

Update 1

I seem to have gotten rid of them. My RAID is resyncing, but the two drives are still marked as spares and are number 3 and 4, which looks wrong. I'll have to wait for the resync to finish.

All I did was to fix the metadata error by editing my mdadm.conf and rebooting. I tried rebooting before, but this time it worked for whatever reason.

Number   Major   Minor   RaidDevice State
   3       8        2        0      spare rebuilding   /dev/sda2
   4       8       18        1      spare rebuilding   /dev/sdb2
   2       8       34        2      active sync   /dev/sdc2

Update 2

After resyncing the problem is exactly the same as before. The two new partitions are listed as spares while the old ones marked as removed are still there.

Is stopping and re-creating the array the only option for me?

share|improve this question
    
Have you tried mdadm /dev/md1 --remove failed and mdadm /dev/md1 --remove detached? –  Zoredache Nov 12 '13 at 20:54
    
Yes, I've tried that before. It doesn't do anything. I only get this output on both commands: mdadm: metadata format 00.90 unknown, ignored. mdadm: metadata format 00.90 unknown, ignored. –  Kabuto Nov 12 '13 at 21:04
    
Sounds to me like you are booted to a kernel that doesn't have the correct support for your old RAID type. Or the mdadm binary you are using doesn't support the old 0.90 format. Reboot to something that supports the 0.90 metadata format? –  Zoredache Nov 12 '13 at 21:08
    
I got the metadata error fixed. See my post update. –  Kabuto Nov 12 '13 at 21:18
add comment

1 Answer 1

I think this should do the job:

mdadm /dev/md1 -r detached
share|improve this answer
    
Unfortunately it doesn't do anything. I've tried it before, and all I get is this output: mdadm: metadata format 00.90 unknown, ignored. mdadm: metadata format 00.90 unknown, ignored. –  Kabuto Nov 12 '13 at 21:03
    
Did you try to stop and reassemble the raid? –  Henrik Nov 12 '13 at 21:12
    
Not yet. I did see this as a last resort. –  Kabuto Nov 12 '13 at 21:15
    
At least you should have sufficient backups before doing this (as usual) - but it's worth a try - btw. you can fix this metadata error by changing metadata=00.90 to metadata=0.90 in mdadm.conf –  Henrik Nov 12 '13 at 21:18
    
Thanks, that's what I did and what got the error fixed. –  Kabuto Nov 12 '13 at 21:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.