mdadm - change spare to active in RAID1 array ??

I’m convinced that mdadm is going to be the death of me. I’ve wasted numerous hours on this so far without luck.

OpenSuse 11.4 on an old Supermicro box, creating a software RAID1 array across 2 x IDE 500GB disks. Creating /dev/md0 as a 250MB partition across /dev/sda1 and /dev/sdd1 for /boot, another 465GB partition across /dev/sda2 and /dev/sdd2 as an LVM partition to hold volumes for the various other OS filesystems. After the initial installation and configuration there were a series of mishaps with faulty IDE cables that had drives failing to show up at boot. Somehow, /dev/sdd2 got configured to array /dev/md1 as a spare drive. And nothing I’ve done so far gets it to show up as an active drive.

The obvious step of failing the partition, removing it, then adding (or re-adding) will bring it back as a spare. I’ve tried roughly a dozen different permutations of those same steps. The latest was to ‘dd if=/dev/zero of=/dev/sdd2’ to clear the partition. Thought this might be the trick - after the zero, mdadm -E /dev/sdd2 reported ‘no superblock’ and no md1 configuration.

So ‘mdadm --add /dev/md1 /dev/sdd2’ and it still comes back as a spare. Here is mdadm -D /dev/md1

/dev/md1:
Version : 1.0
Creation Time : Sat Jul 9 10:26:01 2011
Raid Level : raid1
Array Size : 488119160 (465.51 GiB 499.83 GB)
Used Dev Size : 488119160 (465.51 GiB 499.83 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent

Intent Bitmap : Internal

Update Time : Sun Aug  7 14:57:29 2011
      State : active, degraded

Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1

       Name : linux:1
       UUID : ca504730:4bbac974:8ade88e2:6307210b
     Events : 80190

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

   2       8       50        -      spare   /dev/sdd2

I can’t stop this array, the OS is running from there. I can’t easily boot from CD to repair, all IDE ports have disks attached.

Does anyone have an incantation to promote a spare to active ??

thanks,
Don M.

Hello dm6079,

I see this is your first post. Welcome to these forums.
There are people here who know more about *mdadm, *but I am not one of those, thus have some patience until at least the world turned fully around and everybody got awake :wink:

In the meantime, I see that you tried to post your computer output as readable as possible by making it a fixed font. It will get even better if you use CODE tags instead. Because the way to do that is not very obvious, we have a small guide for that: Posting in Code Tags - A Guide

dm6079 wrote:
> I’m convinced that mdadm is going to be the death of me. I’ve wasted
> numerous hours on this so far without luck.
>
> OpenSuse 11.4 on an old Supermicro box, creating a software RAID1 array
> across 2 x IDE 500GB disks. Creating /dev/md0 as a 250MB partition
> across /dev/sda1 and /dev/sdd1 for /boot, another 465GB partition across
> /dev/sda2 and /dev/sdd2 as an LVM partition to hold volumes for the
> various other OS filesystems. After the initial installation and
> configuration there were a series of mishaps with faulty IDE cables that
> had drives failing to show up at boot. Somehow, /dev/sdd2 got
> configured to array /dev/md1 as a spare drive. And nothing I’ve done so
> far gets it to show up as an active drive.
>
> The obvious step of failing the partition, removing it, then adding (or
> re-adding) will bring it back as a spare. I’ve tried roughly a dozen
> different permutations of those same steps. The latest was to ‘dd
> if=/dev/zero of=/dev/sdd2’ to clear the partition. Thought this might be
> the trick - after the zero, mdadm -E /dev/sdd2 reported ‘no superblock’
> and no md1 configuration.
>
> So ‘mdadm --add /dev/md1 /dev/sdd2’ and it still comes back as a spare.
> Here is mdadm -D /dev/md1
>
> /dev/md1:
> Version : 1.0
> Creation Time : Sat Jul 9 10:26:01 2011
> Raid Level : raid1
> Array Size : 488119160 (465.51 GiB 499.83 GB)
> Used Dev Size : 488119160 (465.51 GiB 499.83 GB)
> Raid Devices : 2
> Total Devices : 2
> Persistence : Superblock is persistent
>
>
> Intent Bitmap : Internal
>
> Update Time : Sun Aug 7 14:57:29 2011
> State : active, degraded
> Active Devices : 1
> Working Devices : 2
> Failed Devices : 0
> Spare Devices : 1
>
> Name : linux:1
> UUID : ca504730:4bbac974:8ade88e2:6307210b
> Events : 80190
>
> Number Major Minor RaidDevice State
> 0 0 0 0 removed
> 1 8 2 1 active sync /dev/sda2
>
> 2 8 50 - spare /dev/sdd2
>
>
> I can’t stop this array, the OS is running from there. I can’t easily
> boot from CD to repair, all IDE ports have disks attached.
>
> Does anyone have an incantation to promote a spare to active ??
>
> thanks,
> Don M.

Just skimming quickly, so some fairly random ideas …

Apart from the mdadm man page, other links I’ve found useful include:

<http://www.novell.com/documentation/sles11/pdfdoc/stor_admin/stor_admin.pdf>
>https://raid.wiki.kernel.org/index.php/RAID_setup> (et al)

Do your IDE ports each have two disks attached? If not, can’t you attach
a CD reader as a secondary device?

And as an aside … this is one reason why I don’t run /boot or / as
RAIDs. I just keep a spare operating system on another disk or two.

Cheers, Dave