# kernel unable to mount raid-root

## totycro

Hello,

I want to use a raid on two identical discs (500GB Samsung S-ATA II 501LJ 16MB), so i followed this HowTo: http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID

My problem is that i can't get the kernel to mount to root partition after installing Gentoo in a chroot of a live cd, it always prints this error message: "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,1)".

The internet told me to compile the filesystem (ext3), raid (level 0 & 1) and SATA controller (SiS 180) driver into the kernel, which i did (my config is appended at the bottom of this post), but the kernel nevertheless isn't able to mount root.

Does anyone have an idea or a pointer about what i could try to make the kernel boot, or maybe what the source of my problem could be?

Infos:

kernel sources: linux-2.6.25-gentoo-r4

/etc/fstab:

```
# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

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

/dev/md1                /               ext3            noatime         0 1

/dev/md2                none            swap            sw              0 0

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

/dev/fd0                /mnt/floppy     auto            noauto          0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

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

/etc/mdadm.conf

```
DEVICE /dev/sd[ab][123]

MAILADDR root

ARRAY /dev/md0 level=raid1 num-devices=2 name=0 UUID=d07d9e58:df8f5d5c:b559f913:d3db5ff4

ARRAY /dev/md1 level=raid0 num-devices=2 name=1 UUID=6a480871:ea8ae5d5:73662027:4089abb1

ARRAY /dev/md2 level=raid0 num-devices=2 name=2 UUID=4e8cca2f:50420ab2:f8a670e2:1a58fe58
```

fdisk -l /dev/sda

```
Disk /dev/sda: 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/sda1   *           1          12       96358+  fd  Linux raid autodetect

/dev/sda2              13       60758   487942245   fd  Linux raid autodetect

/dev/sda3           60759       60801      345397+  fd  Linux raid autodetect
```

fdisk -l /dev/sdb

```
Disk /dev/sdb: 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/sdb1   *           1          12       96358+  fd  Linux raid autodetect

/dev/sdb2              13       60758   487942245   fd  Linux raid autodetect

/dev/sdb3           60759       60801      345397+  fd  Linux raid autodetect
```

lspci -v 

```
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 760/M760 Host (rev 03)

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 32

        Memory at d0000000 (32-bit, non-prefetchable) [size=128M]

        Capabilities: [a0] AGP version 3.1

        Capabilities: [d0] HyperTransport: Slave or Primary Interface

        Capabilities: [f0] HyperTransport: Interrupt Discovery and Configuration

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SG86C202 (prog-if 00 [Normal decode])

        Flags: bus master, 66MHz, medium devsel, latency 99

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=32

        I/O behind bridge: 0000d000-0000dfff

        Memory behind bridge: e8000000-e80fffff

        Prefetchable memory behind bridge: d8000000-e7ffffff

00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS964 [MuTIOL Media IO] (rev 36)

        Flags: bus master, medium devsel, latency 0

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev 01) (prog-if 80 [Master])

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 128

        I/O ports at <unassigned>

        I/O ports at <unassigned>

        I/O ports at <unassigned>

        I/O ports at <unassigned>

        I/O ports at 4000 [size=16]

00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 32, IRQ 18

        Memory at e8125000 (32-bit, non-prefetchable) [size=4K]

00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 32, IRQ 19

        Memory at e8120000 (32-bit, non-prefetchable) [size=4K]

00:03.2 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 32, IRQ 20

        Memory at e8121000 (32-bit, non-prefetchable) [size=4K]

00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller (prog-if 20 [EHCI])

        Subsystem: Silicon Integrated Systems [SiS] USB 2.0 Controller

        Flags: bus master, medium devsel, latency 32, IRQ 17

        Memory at e8122000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [50] Power Management version 2

00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, medium devsel, latency 32, IRQ 21

        I/O ports at e000 [size=256]

        Memory at e8123000 (32-bit, non-prefetchable) [size=4K]

        [virtual] Expansion ROM at 40000000 [disabled] [size=128K]

        Capabilities: [40] Power Management version 2

00:05.0 IDE interface: Silicon Integrated Systems [SiS] RAID bus controller 180 SATA/PATA  [SiS] (rev 01) (prog-if 85 [Master SecO PriO])

        Subsystem: Foxconn International, Inc. Device 0c92

        Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16

        I/O ports at ed00 [size=8]

        I/O ports at e800 [size=4]

        I/O ports at e900 [size=8]

        I/O ports at ea00 [size=4]

        I/O ports at eb00 [size=16]

        I/O ports at <unassigned>

        Capabilities: [58] Power Management version 2

00:08.0 Multimedia audio controller: Creative Labs SB0400 Audigy2 Value

        Subsystem: Creative Labs Device 1001

        Flags: bus master, medium devsel, latency 32, IRQ 22

        I/O ports at ec00 [size=64]

        Capabilities: [dc] Power Management version 2

00:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

        Subsystem: Realtek Semiconductor Co., Ltd. RT8139

        Flags: bus master, medium devsel, latency 32, IRQ 21

        I/O ports at e400 [size=256]

        Memory at e8124000 (32-bit, non-prefetchable) [size=256]

        Capabilities: [50] Power Management version 2

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

        Flags: fast devsel

        Capabilities: [80] HyperTransport: Host or Secondary Interface

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

        Flags: fast devsel

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

        Flags: fast devsel

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

        Flags: fast devsel

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 NJ [Radeon 9800 XT] (prog-if 00 [VGA controller])

        Subsystem: Micro-Star International Co., Ltd. Device 9560

        Flags: bus master, stepping, 66MHz, medium devsel, latency 32, IRQ 5

        Memory at d8000000 (32-bit, prefetchable) [size=128M]

        I/O ports at d000 [size=256]

        Memory at e8030000 (32-bit, non-prefetchable) [size=64K]

        [virtual] Expansion ROM at e8000000 [disabled] [size=128K]

        Capabilities: [58] AGP version 3.0

        Capabilities: [50] Power Management version 2

01:00.1 Display controller: ATI Technologies Inc RV350 NJ [Radeon 9800 XT] (Secondary)

        Subsystem: Micro-Star International Co., Ltd. Device 9561

        Flags: stepping, 66MHz, medium devsel

        Memory at e0000000 (32-bit, prefetchable) [disabled] [size=128M]

        Memory at e8020000 (32-bit, non-prefetchable) [disabled] [size=64K]

        Capabilities: [50] Power Management version 2
```

/boot/grub/grub.conf

```
timeout 10

default 0

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title naql

root (hd0,0)

kernel /boot/kernel root=/dev/md1 md=1,/dev/sda2,/dev/sdb2

boot
```

kernel config

http://phpfi.com/319946Last edited by totycro on Wed May 28, 2008 6:19 pm; edited 1 time in total

----------

## NeddySeagoon

totycro,

```
Unable to mount root fs on unknown-block(9,1)
```

Is a reference to /dev/md1 which is good.

It normally means that the file system driver is missing from the kernel.

Other missing kernel features give other numbers.

Do you have both raid support and ext3 support built in?

Modules will not work. 

Check that your on screen boot messages include:

```
[    3.124922] md: Autodetecting RAID arrays.

[    3.325691] md: Scanned 14 and added 14 devices.

[    3.325691] md: autorun ...

[    3.325693] md: considering sdb10 ...

[    3.329697] md:  adding sdb10 ...

<snip>

[    3.599370] md: ... autorun DONE.
```

which indicates the raid auto assemble working.

```
[    3.124922] md: Autodetecting RAID arrays.

[    3.599370] md: ... autorun DONE.
```

would be a bad sign.

Lastly, in your /etc/fstab set all the dump/pass numbers to zero.

----------

## totycro

The kernel prints something about device-mapper; i can't really read the boot messages, they pass by quickly and aren't saved anywhere.. is there a way to view/save them?

When the kernel panics, the screen shows this:

```

0102         8192 ram2 (driver?)

0103         8192 ram3 (driver?)

0104         8192 ram4 (driver?)

[ similar messages until ram15 ]

0340      4194302 hdb driver: ide-cdrom

0800    488386584 sda driver: sd

  0801          96358 sda1

  0802      487942245 sda2

  0803        345397  sda3

0800    488386584 sdb driver: sd

  0801          96358 sdb1

  0802      487942245 sdb2

  0803        345397  sdb3

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,1)
```

ext3 & raid are built in:

```
CONFIG_EXT3_FS=y

[...]

CONFIG_MD=y

CONFIG_BLK_DEV_MD=y

CONFIG_MD_LINEAR=y

CONFIG_MD_RAID0=y

CONFIG_MD_RAID1=y
```

----------

## NeddySeagoon

totycro,

You have followed the howto for kernel raid, so device mapper should not be used.

Its only needed if you use BIOS software raid. Any RAID options in your BIOS should be off.

It may still load, thats harmless.

You have two SIS chipset drivers in your kernel. Thats a little worrying as it can mean that none of them work properly.

Set up your kernel like this except you need the SIS option under the SATA emu. If that causes problems with your CDROM we can fix that later.

----------

## totycro

In my BIOS, i found those two possibly relevant settings:

```
SiS Serial ATA Controller    [Enabled]

SiS Serial ATA Mode          [IDE]
```

That should be correct, i guess..

I recompiled the kernel according to your tutorial, now with only one SiS driver (CONFIG_SATA_SIS, the one which i'm quite sure that i need). The only change i noticed is that now the screen doesn't show the line with hdb, but this:

```
0b00    1048575 sr0 driver: sr
```

The rest unfortunately stayed exactly the same.   :Confused: 

----------

## NeddySeagoon

totycro,

```
SiS Serial ATA Mode          [IDE]
```

What are the choices ?

IDE is often a slow backwards compatible mode, its intended to allow you to install windows then update to the drivers for the other mode.

If the other option is AHCI, you will want the AHCI driver mentioned in my reference.

If its Native or Raid, it may just work when you switch modes in the BIOS

----------

## totycro

The other choice is "RAID", then i think i could create a hardware raid via BIOS.

When i boot with this setting, the same thing as before happens.

----------

## gentoo_ram

I would take the following parameter out of your kernel command line.  It shouldn't be needed and may be messing things up:

```

md=1,/dev/sda2,/dev/sdb2 

```

Watch very carefully when your kernel is booting.  At the end you should see messages something like this:

```

md: Autodetecting RAID arrays.

md: Scanned 6 and added 6 devices.

md: autorun ...

md: considering sdb5 ...

md:  adding sdb5 ...

md: sdb3 has different UUID to sdb5

md: sdb1 has different UUID to sdb5

md:  adding sda5 ...

md: sda3 has different UUID to sdb5

md: sda1 has different UUID to sdb5

md: created md5

md: bind<sda5>

md: bind<sdb5>

md: running: <sdb5><sda5>

raid1: raid set md5 active with 2 out of 2 mirrors

md: considering sdb3 ...

md:  adding sdb3 ...

md: sdb1 has different UUID to sdb3

md:  adding sda3 ...

md: sda1 has different UUID to sdb3

md: created md3

md: bind<sda3>

md: bind<sdb3>

md: running: <sdb3><sda3>

raid1: raid set md3 active with 2 out of 2 mirrors

md: considering sdb1 ...

md:  adding sdb1 ...

md:  adding sda1 ...

md: created md1

md: bind<sda1>

md: bind<sdb1>

md: running: <sdb1><sda1>

raid1: raid set md1 active with 2 out of 2 mirrors

md: ... autorun DONE.

```

If you don't see your RAID devices getting auto-created, then that's your problem.  These devices were created at install-time, right?  You can't create RAID devices out of nothing at boot.

----------

## totycro

Removing "md=1,/dev/sda2,/dev/sdb2" doesn't seem to change anything..   :Sad: 

As far as i can tell the kernel prints just very few lines starting with "md:" (maybe 2 to 5), but i can't say for sure. If that is really my problem, what could i try to fix this?

I created the RAID devices with a livecd, with this command: "mdadm --create --verbose /dev/md1 --level=0 -n 2 /dev/sda2 /dev/sdb2".

Assemling the RAID via "mdadm -A /dev/md1 /dev/sda2 /dev/sdb2" from a livecd works, the partition then can be mounted just like a normal partition.

----------

## totycro

I found this tutorial in the internet: http://linux-raid.osdl.org/index.php/RAID_Boot. It's about booting from initramfs; i tried it, but it didn't work. However now the kernel panics sooner, so i can read the output of the md driver:

```
md: linear personality registered for level -1

md: raid0 peronality registered for level 0

md: raid1 personality registered for level 1

md: multipath personality registered for level -4

md: faulty personality registered for level -5
```

I don't really know what that means though, but i assume it contains the error; does anyone understand this?

----------

## NeddySeagoon

totycro,

Those are status messages generated by the kernel raid code as it starts.

You need only 

```
md: raid0 peronality registered for level 0

md: raid1 personality registered for level 1 
```

for your setup.

The others listed are for testing only or features you do not have/want to use.

Post your latest kernel config and I'll look it over but probably not until Tuesday

----------

## totycro

Thanks for your help, guys, but a very different aproached now solved my problem. The kernel boots flawlessly with an initramfs according to this tutorial: http://linux-raid.osdl.org/index.php/RAID_Boot

----------

## NeddySeagoon

totycro,

Thank you for the link. I'm still using kernel autodetect.

It looks like I will have to migrate soon.

----------

