Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: kruhm on December 25, 2012, 08:57:38 PM

Title: New HD added in raid device md2 as spare
Post by: kruhm on December 25, 2012, 08:57:38 PM
Hi Everyone,

I swapped a hard drive out on a server and added it back in via console. When it finished, I noticed the process added the new hard drive into md1 correctly but didn't add it back into md2 as active (which is what I expected) but as a spare.

Can someone help me the new hard drive sdb2 into md2?

The results are below:

Code: [Select]
]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb1[1] sda1[0]
      104320 blocks [2/2] [UU]

md2 : active raid1 sdb2[2](S) sda2[0]
      488279552 blocks [2/1] [U_]

unused devices: <none>

Code: [Select]
# mdadm --detail /dev/md2
/dev/md2:
        Version : 0.90
  Creation Time : Sat Aug 26 08:32:50 2006
     Raid Level : raid1
     Array Size : 488279552 (465.66 GiB 500.00 GB)
  Used Dev Size : 488279552 (465.66 GiB 500.00 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Tue Dec 25 07:50:50 2012
          State : clean, degraded
 Active Devices : 1
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 1

           UUID : ce917023:5da6a14f:2a9c304f:a380120a
         Events : 0.144857428

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

       2       8       18        -      spare   /dev/sdb2

Thanks in advance & Merry Christmas,
Title: Re: New HD added in raid device md2 as spare
Post by: idp_qbn on December 26, 2012, 05:47:33 AM
Hi kruhm,
I had this fragment of advice from years ago on the SME forums but I can't find it there now. Still, here is what I have in my notes - and I have successfully used it more than once:

Rebuild Raid when disk is missing

First step - run "console"Option 5 Manage Disk Redundancy to see if there is an error.


For bad md1
===========

To add missing IDE drive hda1:
mdadm -a /dev/md1 /dev/hda1

To add missing SATA drive sda1:
mdadm -a /dev/md1 /dev/sda1

For bad md2
===========

To add missing IDE drive hda1:
mdadm -a /dev/md2 /dev/hda2

To add missing SATA drive sda2:
mdadm -a /dev/md2 /dev/sda2


Cheers, best wishes for the season .... and good luck.
Ian
Title: Re: New HD added in raid device md2 as spare
Post by: kruhm on December 26, 2012, 02:48:19 PM
Hi Ian,

Thanks for your reply and for keep good notes.

I tried but get the following:
Code: [Select]
# mdadm -a /dev/md2 /dev/sdb2
mdadm: Cannot open /dev/sdb2: Device or resource busy

Hmmm...

I failed it:
Code: [Select]
mdadm -f /dev/md2 /dev/sdb2
Then removed it:
Code: [Select]
mdadm -r /dev/md2 /dev/sdb2
That got rid of the spare. I still have an absent drive:
Code: [Select]
mdadm --detail /dev/md2
    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       0        0        1      removed

So how do I fail and remove a drive that is absent?