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 have a two drive linux software raid 1 for a server. There are two raid devices. (Boot (md0) & OS (md1)) Last week one of the drives failed so i ordered a new one. Today i shutdown the server, installed the new server, and then attempted to add the new drive back into the raid. For some reason it was added as a spare instead of active.

Here was the status of the raid after the failed drive had been removed:

[root@server ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.0
  Creation Time : Mon Nov 25 18:01:08 2013
     Raid Level : raid1
     Array Size : 511936 (500.02 MiB 524.22 MB)
  Used Dev Size : 511936 (500.02 MiB 524.22 MB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

    Update Time : Thu Feb 20 15:19:05 2014
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : 0
           UUID : ff06d319:b29fb1b0:7be4fded:5eff1a05
         Events : 372

    Number   Major   Minor   RaidDevice State
       3       8       97        0      active sync   /dev/sdg1
       1       0        0        1      removed
[root@server ~]# mdadm --detail /dev/md1
/dev/md1:
        Version : 1.1
  Creation Time : Mon Nov 25 18:01:09 2013
     Raid Level : raid1
     Array Size : 249414464 (237.86 GiB 255.40 GB)
  Used Dev Size : 249414464 (237.86 GiB 255.40 GB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Feb 20 15:20:22 2014
          State : active, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : 1
           UUID : 5141caf1:c7c81553:0f1fa3fa:2ffdf6bd
         Events : 4813017

    Number   Major   Minor   RaidDevice State
       0       8       98        0      active sync   /dev/sdg2
       1       0        0        1      removed

I then ran the following commands:

[root@server ~]# sfdisk -d /dev/sdg | sfdisk /dev/sdh --force
[root@server ~]# mdadm --manage /dev/md0 --add /dev/sdh1
mdadm: added /dev/sdh1
[root@server ~]# mdadm --manage /dev/md1 --add /dev/sdh2
mdadm: added /dev/sdh2

I let them rebuild and now i get this for MD1.

[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdh1[2] sdg1[3]
      511936 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sdh2[2](S) sdg2[0]
      249414464 blocks super 1.1 [2/1] [U_]
      bitmap: 2/2 pages [8KB], 65536KB chunk

More detailed info:

[root@server ~]#mdadm --detail /dev/md0
/dev/md0:
        Version : 1.0
  Creation Time : Mon Nov 25 18:01:08 2013
     Raid Level : raid1
     Array Size : 511936 (500.02 MiB 524.22 MB)
  Used Dev Size : 511936 (500.02 MiB 524.22 MB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Thu Feb 20 15:22:51 2014
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : 0
           UUID : ff06d319:b29fb1b0:7be4fded:5eff1a05
         Events : 393

    Number   Major   Minor   RaidDevice State
       3       8       97        0      active sync   /dev/sdg1
       2       8      113        1      active sync   /dev/sdh1
[root@server ~]# mdadm --detail /dev/md1
/dev/md1:
        Version : 1.1
  Creation Time : Mon Nov 25 18:01:09 2013
     Raid Level : raid1
     Array Size : 249414464 (237.86 GiB 255.40 GB)
  Used Dev Size : 249414464 (237.86 GiB 255.40 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Feb 20 16:34:34 2014
          State : active, degraded
 Active Devices : 1
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 1

    Number   Major   Minor   RaidDevice State
       0       8       98        0      active sync   /dev/sdg2
       1       0        0        1      removed

       2       8      114        -      spare   /dev/sdh2

Can someone tell me why this has happened? The last time i ran into this i ended up losing the entire volume. I just want to get MD1 back up and running properly.

share|improve this question
    
Wow, what a PITA. So md0 took to the replacement and is happy and md1 doesn't want to hot-spare in /dev/sdh2? I'd guess the safest path is to remove /dev/sdh2 and re-add it. –  quadruplebucky Feb 21 at 5:44
    
Happened to me too? any clue? –  Superbiji May 21 at 10:11

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.