# Every reboot needs a raid1 resync

## poOoch

Hi, I have mirror setup:

```
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1

# mdadm -Es >> /etc/mdadm.conf
```

created a FS on it, copied all the data and the world is fine.

Now after a reboot mirror 0 is gone:

```
mdadm --detail /dev/md0 

/dev/md0:

        Version : 1.2

  Creation Time : Sun Jun 13 16:56:23 2010

     Raid Level : raid1

     Array Size : 195357305 (186.31 GiB 200.05 GB)

  Used Dev Size : 195357305 (186.31 GiB 200.05 GB)

   Raid Devices : 2

  Total Devices : 1

    Persistence : Superblock is persistent

    Update Time : Sun Jun 13 19:48:58 2010

          State : clean, degraded

 Active Devices : 1

Working Devices : 1

 Failed Devices : 0

  Spare Devices : 0

           Name : poOoch-ws:0  (local to host poOoch-ws)

           UUID : dde15650:1ff9e1cf:b902991d:dfb778db

         Events : 192

    Number   Major   Minor   RaidDevice State

       0       0        0        0      removed

       1       8       33        1      active sync   /dev/sdc1

```

Both devices are there:

```

mdadm --examine /dev/sdb1 /dev/sdc1

/dev/sdb1:

          Magic : a92b4efc

        Version : 1.2

    Feature Map : 0x0

     Array UUID : dde15650:1ff9e1cf:b902991d:dfb778db

           Name : poOoch-ws:0  (local to host poOoch-ws)

  Creation Time : Sun Jun 13 16:56:23 2010

     Raid Level : raid1

   Raid Devices : 2

 Avail Dev Size : 390714754 (186.31 GiB 200.05 GB)

     Array Size : 390714610 (186.31 GiB 200.05 GB)

  Used Dev Size : 390714610 (186.31 GiB 200.05 GB)

    Data Offset : 2048 sectors

   Super Offset : 8 sectors

          State : clean

    Device UUID : d476f8bc:67bfbca5:60a9b1a6:eb303099

    Update Time : Sun Jun 13 19:42:47 2010

       Checksum : 1278c5b3 - correct

         Events : 34

   Device Role : Active device 0

   Array State : AA ('A' == active, '.' == missing)

/dev/sdc1:

          Magic : a92b4efc

        Version : 1.2

    Feature Map : 0x0

     Array UUID : dde15650:1ff9e1cf:b902991d:dfb778db

           Name : poOoch-ws:0  (local to host poOoch-ws)

  Creation Time : Sun Jun 13 16:56:23 2010

     Raid Level : raid1

   Raid Devices : 2

 Avail Dev Size : 390714754 (186.31 GiB 200.05 GB)

     Array Size : 390714610 (186.31 GiB 200.05 GB)

  Used Dev Size : 390714610 (186.31 GiB 200.05 GB)

    Data Offset : 2048 sectors

   Super Offset : 8 sectors

          State : clean

    Device UUID : e756a1bc:60b88a15:b6442412:c8ffa424

    Update Time : Sun Jun 13 19:49:33 2010

       Checksum : 78d80b33 - correct

         Events : 208

   Device Role : Active device 1

   Array State : .A ('A' == active, '.' == missing)

```

dmesg

```

md: linear personality registered for level -1

md: raid0 personality registered for level 0

md: raid1 personality registered for level 1

md: Waiting for all devices to be available before autodetect

md: If you don't use raid, use raid=noautodetect

md: Autodetecting RAID arrays.

md: invalid raid superblock magic on sdb1

md: sdb1 does not have a valid v0.90 superblock, not importing!

md: invalid raid superblock magic on sdc1

md: sdc1 does not have a valid v0.90 superblock, not importing!

md: Scanned 2 and added 0 devices.

md: autorun ...

md: ... autorun DONE.

md: md0 stopped.

md: bind<sdc1>

raid1: raid set md0 active with 1 out of 2 mirrors

md0: detected capacity change from 0 to 200045880320

```

 I use mdadm (init script) to start the array. Raid "Linux Kernel Autodetect" does not work because of too new superblock.

I have to readd sdb1 until next reboot:

```
 mdadm --manage /dev/md0 --re-add /dev/sdb1
```

Using Kernel 2.6.34-gentoo and sys-fs/mdadm-3.1.2. Any hints? Probably I'm spoiled of ZFS on my Solaris boxes so I miss something...  Thx

----------

## KayZee

Using fdisk, did you set your partitions to type "fd"?   fd is used for Linux RAID partitions.

----------

## poOoch

Yes they are fd, but as the superblock is > 0.90 linux kernel does not import them. I'll try a mdadm downgrade.

----------

## hrnick

I have the exact same problem. Did you solve this?

----------

## poOoch

It seems it was a kernel issue. Updated to 2.6.34-gentoo-r1 using sys-fs/mdadm-3.1.2 and now it's fine.

----------

## hrnick

 *poOoch wrote:*   

> It seems it was a kernel issue. Updated to 2.6.34-gentoo-r1 using sys-fs/mdadm-3.1.2 and now it's fine.

 

Upgrading to gentoo-sources-2.6.34-r1 didn't solve this for me. Could you please post the relevant part of your kernel config?

----------

## poOoch

 *hrnick wrote:*   

>  *poOoch wrote:*   It seems it was a kernel issue. Updated to 2.6.34-gentoo-r1 using sys-fs/mdadm-3.1.2 and now it's fine. 
> 
> Upgrading to gentoo-sources-2.6.34-r1 didn't solve this for me. Could you please post the relevant part of your kernel config?

 

```
CONFIG_MD=y

CONFIG_BLK_DEV_MD=y

CONFIG_MD_AUTODETECT=y

CONFIG_MD_LINEAR=y

CONFIG_MD_RAID1=y
```

Perhaps it was also a downgrade of mdadm to 3.1.1-r1, did a reboot and finally upgraded again to 3.1.2 (in parallel to kernel upgrade). Sounds quite illogical but perhaps worth a try. Sorry I'm not sure what the real reason was, I should not work on my home machines with a hangover..

----------

