# LVM on Raid went md127 and refuses sync after reboot

## oliwel

Hi All,

I have a fresh gentoo install which uses lvm over raid1 on two disks. 

Everything was fine when I set up the box, I assembled /dev/sda4 and /dev/sdb4 to become /dev/md4 and create a lvm device on top of md4.

After an (unclean) reboot today, the array shows as "md127 auto-read-only" and "resync=Pending". 

I read in the mdadm docs, that this is a precaution for non-local arrays, BUT the name recorded in the metadata and the hostname match!

```
 hostname: idefix
```

```

 mdadm -E /dev/sda4

/dev/sda4:

          Magic : a92b4efc

        Version : 1.2

    Feature Map : 0x0

     Array UUID : f7a119d5:72e80799:f157ae46:1924c2ee

           Name : idefix:4  (local to host idefix)

  Creation Time : Sat Mar 12 21:13:04 2011

     Raid Level : raid1

   Raid Devices : 2

```

As the lvm on top is running as soon as the box gets up, I am unable to stop the lvm/raid and reassemble the array as it is suggested in some ML postings. So anybody can point me to a solution?

Sidenote: After simply mounting one of the lvm drives the array automagically goes into rw mode and starts syncing....

Oliver

----------

## nativemad

Hi, 

i use "md=0,/dev/sda3,/dev/sdb3" as kernel bootoption, to prevent the md127 thing...  :Wink: 

As i use it also as system partition, i can't tell anything about your rw and sync behavior...

Cheers

----------

## frostschutz

You can set the prefered md number with mdadm, using the --update=super-minor option. That's what will be used when using auto assemble or the kernel builtin raid autodetect (for raid 0.9 superblock and fd partitions). --examine / --detail should also report this number as preferred minor.

can't really help you with the hostname, never used that feature for my raids... in my case its not set at the time of raid assemblance anyway

----------

## oliwel

 *frostschutz wrote:*   

> You can set the prefered md number with mdadm, using the --update=super-minor option. That's what will be used when using auto assemble or the kernel builtin raid autodetect (for raid 0.9 superblock and fd partitions). --examine / --detail should also report this number as preferred minor.
> 
> 

 

The raid has version 1.2 meta data which does not have a super-minor option.

A friend suggested setting a proper name resolve in /etc/hosts which did not help out anyway. The raid is still starting as md127.

I even cant reassemle the array as I can not stop it while lvm is running - anybody perhaps can tell me how to stop lvm blocking the device?

Oliver

----------

