# raid 1 md: invalid superblock magic hdXN, not importing

## mattmatteh

i just installed gentoo on raid1 and when bootiing i get an error and a kernel panic.

md: invalid raid superblock magic on hdXN

md: hdXN has invalid sb, not importing

i can start the raid array without problems from a gentoo livecd or a knoppix livecd.  i am not using an initrd and dont think i need one.  all partitions are fd linux raid autodetect.  i have set up raid1 before on my file server and did have a similiar issue where i had to create the device nodes on the file system.  i tried that again but same error.  the disks used are a week old from newegg (it was suggested on irc that the disk are bad).  ide and raid1 are compiled into the kernel.

does anyone have any suggestions ?

thanks

matt

----------

## snIP3r

 *mattmatteh wrote:*   

> i just installed gentoo on raid1 and when bootiing i get an error and a kernel panic.
> 
> md: invalid raid superblock magic on hdXN
> 
> md: hdXN has invalid sb, not importing
> ...

 

could you post your bootmanager config and fstab? perhaps something is not configured correctly, i remember installing grub in a raid 1 config is not that easy...

you wrote you can start the array, but were you also able to mount it?

just my 2 cents...

HTH

snIP3r

----------

## VoVaN

Could you check if partition type in cfdisk is "Linux raid autodetect" (FD) for your raid devices?

----------

## mattmatteh

here is grub and fstab.  i used knoppix to start the array and was able to mount it.  i removed comments.

root@Knoppix:/dev# cat /mnt/gentoo/boot/grub/grub.conf

timeout 30

default 0

fallback 1

# For booting GNU/Linux

title gentoo disk 0

root (hd0,0)

kernel /vmlinuz-2.6.22-gentoo-r5 ro root=/dev/md2 video=vesafb

# For booting GNU/Linux

title gentoo disk 1

root (hd1,0)

kernel /vmlinuz-2.6.22-gentoo-r5 ro root=/dev/md2 video=vesafb

root@Knoppix:/dev# 

root@Knoppix:/dev# cat /mnt/gentoo/etc/fstab 

/dev/md0                /boot           ext3            noauto,noatime  1 2

/dev/md2                /               ext3            noatime         0 1

/dev/md1                none            swap            sw              0 0

/dev/cdrom              /mnt/cdrom      audo            noauto,ro       0 0

shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

root@Knoppix:/dev# 

i removed some non important lines.

root@Knoppix:/dev# cat /proc/mounts 

/dev/md2 /mnt/gentoo ext3 rw,data=ordered 0 0

/dev/md0 /mnt/gentoo/boot ext3 rw,data=ordered 0 0

root@Knoppix:/dev# 

root@Knoppix:/dev# fdisk -l /dev/hde

Disk /dev/hde: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hde1   *           1           7       56196   fd  Linux raid autodetect

/dev/hde2               8         133     1012095   fd  Linux raid autodetect

/dev/hde3             134        2141    16129260   fd  Linux raid autodetect

/dev/hde4            2142       60801   471186450   fd  Linux raid autodetect

root@Knoppix:/dev# fdisk -l /dev/hdg

Disk /dev/hdg: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hdg1               1           7       56196   fd  Linux raid autodetect

/dev/hdg2               8         133     1012095   fd  Linux raid autodetect

/dev/hdg3             134        2141    16129260   fd  Linux raid autodetect

/dev/hdg4            2142       60801   471186450   fd  Linux raid autodetect

root@Knoppix:/dev#

----------

## VoVaN

Everything looks good, only the thing you can try -s running mdadm with --zero-superblock option for both drives and construct array again.

----------

## mattmatteh

i am not sure i understand what you suggested i could try.  will that destroy what i installed?

i was searching again and found this http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID_mirror_and_LVM2_on_top_of_RAID and contains:

Note: It looks like the latest version of mdadm uses version 1.0 superblocks by default. These will not be autodetected on startup, as the maintainer has altered them specifically not to! I got around this by adding the '-e 0.90' switch to these lines, thus creating a superblock that will be detected on boot (the official line is that you should create an initrd).

has anyone else run into this problem?  who is using version 1 and who is using an initrd ?

thanks

matt

----------

## VoVaN

 *mattmatteh wrote:*   

> i am not sure i understand what you suggested i could try.  will that destroy what i installed?
> 
> i was searching again and found this http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID_mirror_and_LVM2_on_top_of_RAID and contains:
> 
> Note: It looks like the latest version of mdadm uses version 1.0 superblocks by default. These will not be autodetected on startup, as the maintainer has altered them specifically not to! I got around this by adding the '-e 0.90' switch to these lines, thus creating a superblock that will be detected on boot (the official line is that you should create an initrd).
> ...

 

Thank you for posting this. Is n this case forget about my suggestion. I'm using mdadm-2.6.2 and superblocks for all my arrays have version 00.90.03, the last one created a week ago. 

```
/dev/md5:

        Version : 00.90.03

  Creation Time : Wed Sep 12 10:25:28 2007

     Raid Level : raid1

     Array Size : 48829440 (46.57 GiB 50.00 GB)

  Used Dev Size : 48829440 (46.57 GiB 50.00 GB)

   Raid Devices : 2

  Total Devices : 2

Preferred Minor : 5

    Persistence : Superblock is persistent

    Update Time : Tue Sep 18 07:00:04 2007

          State : clean

 Active Devices : 2

Working Devices : 2

 Failed Devices : 0

  Spare Devices : 0

           UUID : 9966b503:62c2e196:69032a75:ae9dd2a3

         Events : 0.8470

    Number   Major   Minor   RaidDevice State

       0      22        7        0      active sync   /dev/hdc7

       1       3        7        1      active sync   /dev/hda7

```

----------

## mattmatteh

i decided to re create the arrays with version 0.9.  stupid that version 1.0 is broke.

matt

----------

## VoVaN

 *mattmatteh wrote:*   

> i decided to re create the arrays with version 0.9.  stupid that version 1.0 is broke.
> 
> matt

 

Strangely, why in my case mdadm creates superblock version 0.9 by default? Which version of mdadm you're using?

----------

