# [SOLVED]MDRaid bootup issue

## regomodo

Hi,

I have a raid0 setup of x2 500GB sata's that are formatted with ext4. It works fine except for mounting it on bootup. I've setup software raid fine in the past but for some reason my raid won't mount on bootup.

The 2 initscripts for soft-raid are there:

```
funtoo-pc ~ # rc-update show | grep md

                mdadm | boot

               mdraid | boot
```

/etc/mdadm.conf looks like this

```
ARRAY /dev/md1 metadata=0.90 UUID=b60f1c79:e60c7a4f:a2d5e656:0f160a2a

```

I'm using vanilla linux kernel-2.6.32.3 with no initrd image. Could that be the cause?Last edited by regomodo on Mon Jan 18, 2010 6:33 pm; edited 1 time in total

----------

## NeddySeagoon

regomodo,

You must set the underlying  partition type to 0xfd, so the kernel knows to auto assemble the raid.

The kernel needs 

```
[*]     Autodetect RAID arrays during kernel boot
```

which is not a default setting

Your initscripts cannot be read until root is mounted and if root is on raid0, the kernel has to assemble the raid set before it can mount root.

There is a corner case where the kernel cannot autoassemble the raid set. Thats when you make the raid set on whole drives, not on partitions ... in that case there is no partition to set to type 0xfd. IF you have root on such a raid set, you must use and initrd.

----------

## regomodo

 *NeddySeagoon wrote:*   

> regomodo,
> 
> You must set the underlying  partition type to 0xfd, so the kernel knows to auto assemble the raid.
> 
> The kernel needs 
> ...

 

That setting is enabled but I did not set the partition type to 0xfd. That's done in fdisk right?

My raid is on partitions so I don't need an initrd.

----------

## NeddySeagoon

regomodo,

Yes - its harmless to your data.

```
 $ sudo fdisk -l /dev/sda

Password: 

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

Disk identifier: 0x0553caf4

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1           5       40131   fd  Linux raid autodetect

/dev/sda2               6          70      522112+  82  Linux swap / Solaris

/dev/sda4              71      121601   976197757+   5  Extended

/dev/sda5              71         724     5253223+  fd  Linux raid autodetect

/dev/sda6             725      121601   970944471   fd  Linux raid autodetect

```

----------

## regomodo

 *NeddySeagoon wrote:*   

> regomodo,
> 
> Yes - its harmless to your data.
> 
> ```
> ...

 

Nuts

```
Disk /dev/md1: 1000.2 GB, 1000210300928 bytes

2 heads, 4 sectors/track, 244191968 cylinders

Units = cylinders of 8 * 512 = 4096 bytes

Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

```

Can't do it now but i'll start over.

----------

## gentoo_ram

Don't run fdisk on the md device.  Run it on the physical device (/dev/sda, for example).

----------

## regomodo

 *gentoo_ram wrote:*   

> Don't run fdisk on the md device.  Run it on the physical device (/dev/sda, for example).

 

Ah right. Get ya.

----------

## regomodo

Solved it by setting the partition type. Thanks for your help all.

With the zfs-fuse and btrfs issues I haven't been able to automount this raid since forever.

----------

