# cannot open root device on boot. new kernel

## luvis

I have been compiling my kernels a couple of times before and managed, but not in gentoo. I jusst switched to gentoo.

I'm now trying to compile my own kernel but when i try to boot, I get this problem.

Cannot open root device "hda1" or unknown-block (0,0)

Please append a correct "root=" option

Kernel panic- not syncing:VFS:

unable to mount root fs on unknown-block (0,0)

I'm guessing I'm missing something in my kernel but I just cant figure out what?

I have reiserfs and ext3 support wich is the filesystem types I use.

I have been looking around in "block - devices" but not found anything that I'm missing (atleast i don't think so)

My working kernel has a initrd.img. Do you think that is what I need? If that is so, how do I make an initrd.img?

Please help me! I'm pretty new with actually trying to "configure" my system..

----------

## c4

Is your fstab correct and also, have you setup grub (or lilo) correctly?

It is often some misconfiguration with one of these two that causes the kernel to panic on boot.

----------

## NeddySeagoon

luvis,

This 

```
unknown-block (0,0)
```

means the kernel cannot communicate with the hard drive.

You have not included your HDD chip set driver in the kernel.

----------

## luvis

thankyou for the answers!

I have my fstab set up correctly.

my grub i set up with grubconf since I have no idea how it works.

Neddy, how do I know what HDD chip set I have? and where in the kernel can I find it?

thanks!

----------

## NeddySeagoon

luvis,

Run lspci, either from the liveCD or your own system.

It will list either an IDE Interface or a SATA interface, perhaps both.

Post the lines here.

Do you know if your drive is SATA or IDE ?

What are the /dev names for your partitions, that will tell me ?

----------

## dlm1065

I had a kernel(2.6.12-r##) the other day loaded & ran fine but I was playing 

with the new unstable gnome and also trying to get modular X and fubar'd 

my setup so I wiped 

Reinstall came up with a newer kernel (2.6.13-r3).

I am getting the EXACT same message except it sdb2 instead of hda1

Can I ask are you using software raid or are you amd64 by any chance?? 

did you compile grub or use the static??

----------

## NeddySeagoon

dlm1065,

The message 

```
unknown-block (X,Y)
```

tells the device major, minor number that the 

kernel is trying to mout as root. (0,0) is not legal and means the kernel cannot communicate with the drive.

Other numbers can be looked up in /usr/src/linux/Documentation/devices.txt

Such errors (otherthan the (0,0) indicate the kernel cannot read the filesystem.

----------

## dlm1065

 *NeddySeagoon wrote:*   

> dlm1065,
> 
> The message 
> 
> ```
> ...

 

NeddySeagoon 

 You are most likely correct. 

 That said the issue is that I am using the same pencil/paper ver of fstab, mdadm.conf, grub.conf that I used 2 days ago. The only issue then was easily worked around. That issue was that on boot grub booted the active partition as (hd0,1) instead of (hd1,1) so I just changed the grub.conf to reflect that and boom in she went.

I did re-install grub this time around and it did is NOT behaving the same as it did before.

It is booting (hd1,1) and will load (hd1,0) properly but linux is fried.

I just removed gentoo-sources reisntalled w ~amd64 to get the newer 2.6.13-r4

ver and Now I get

 *Quote:*   

> VFS: Mounted root (ext2 filesystem) readonly
> 
> Freeing unused kernel memory
> 
> Warning: unable to open an initial console
> ...

 

----------

## luvis

Hi guys! Sorry for my late reply, I fell asleep.

This is my lspci output. I have addet the via chipset support in my kernel but it still doesn't boot.

Do you think it could have anything to do with my grub.conf?

0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8385 [K8T800 AGP] Host Bridge (rev 01)

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]

0000:00:07.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

0000:00:09.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0 :Cool: 

0000:00:09.1 Input device controller: Creative Labs SB Live! MIDI/Game Port (rev 0 :Cool: 

0000:00:0a.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)

0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)

0000:00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)

0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]

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

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

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

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

0000:01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600/GeForce 6600 GT] (rev a2)

This i my grub.conf

# Generated by grubconf-0.5.1

default=2

timeout=5

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

title VLOS 1.2 (2.6.12-vidalinux_r3)

#:0 <-- type: 0 => linux, 1 => windows, 2 => other

        root (hd0,0)

        kernel /boot/vmlinuz-2.6.12-vidalinux_r3 root=/dev/hda1 ro init=/linuxrc real_root=/dev/hda1 splash=silent,theme:vlos-1.2 vga=0x318 quiet CONSOLE=/dev$

initrd /boot/initrd-2.6.12-vidalinux_r3.img

title gentoo

#:0 <-- type: 0 => linux, 1 => windows, 2 => other

        root (hd0,0)

        kernel /boot/bzImage

The top one has a bunch of extra parameters, should I add something to the bottom one?

----------

## NeddySeagoon

luvis,

Your post raises more questions than it provides answers. I'll take you though what the various parameters on the kernel line mean.

Your top grub.conf has  

```
kernel /boot/vmlinuz-2.6.12-vidalinux_r3 root=/dev/hda1 ro init=/linuxrc real_root=/dev/hda1 splash=silent,theme:vlos-1.2 vga=0x318 quiet CONSOLE=/dev$

initrd /boot/initrd-2.6.12-vidalinux_r3.img 
```

The 

```
/boot/vmlinuz-2.6.12-vidalinux_r3
```

is the fime name of the kernel to be loaded

```
root=/dev/hda1
```

is the partition to be monted as root. These entries must both be present and are the minimum required.

```
init=/linuxrc 
```

is the name of the initalisation script to be run - its only required when you use an inital RAM drive (initrd) which you almost do here.

```
real_root=/dev/hda1
```

is the root filesystem on disk, to be used when you are finished with the initrd.

The rest of the line sets up the framebuffer splash screen.

The last line 

```
initrd /boot/initrd-2.6.12-vidalinux_r3.img
```

loads the initrd file and attaches it to /dev/ram0, so the kernel can use it as a fake root filesystem

I said earlier that you were 'almost' using an initrd. This line 

```
kernel /boot/vmlinuz-2.6.12-vidalinux_r3 root=/dev/hda1 ro init=/linuxrc real_root=/dev/hda1 splash=silent,theme:vlos-1.2 vga=0x318 quiet CONSOLE=/dev$
```

needs to have its root=/dev/hda1 changed to root=/dev/ram0 to actually use it.

If you understand what I've said, you will see whats needed with the

```
title gentoo 
```

boot block to make it meet minimum requirements.

----------

## NeddySeagoon

dlm1065,

Do you have a removable USB storage device attached?

Grub counts that if your BIOS can boot from USB. This device comming and going can change grubs drive numbers, which in turn affects boot behaviour.

----------

## dlm1065

 *NeddySeagoon wrote:*   

> dlm1065,
> 
> Do you have a removable USB storage device attached?
> 
> Grub counts that if your BIOS can boot from USB. This device comming and going can change grubs drive numbers, which in turn affects boot behaviour.

 

Nope. I think it has to do with the way this mb bios is handling the

3 Samsung SATA2 drives. Note that the drives seem to be misnumbered

under both linux and windows.

MB_Port_Bios____________linux__windows

1_______Master SATA 1___sdb____ide 1

2_______Master SATA 2___sdc____ide 2

3_______Master SATA 3___sda____ide 0

I partitioned the 3 SATA drives

	Primary(40Gig)	Primary(1Gig)		Extended(remaining @70+Gig)

 1	Win(data)	swap			linux soft raid logical 5-9

 2	Win(boot)	/boot			linux soft raid logical 5-9

3	Win(data)	swap			linux soft raid logical 5-9

If on boot I edit the  (hd1,0) to (hd0,0) or the (hd1,1) to (hd0,1) in the grub menu

this allows windows to boot or I can get to the 

 *Quote:*   

> VFS: Mounted root (ext2 filesystem) readonly 
> 
> Freeing unused kernel memory 
> 
> Warning: unable to open an initial console 
> ...

 

trying to edit the sdb2 to sda2 or sdc2 though does not appear to work

mdadm.conf

DEVICE /dev/sd[abc]5

DEVICE /dev/sd[abc]6

DEVICE /dev/sd[abc]7

DEVICE /dev/sd[abc]8

DEVICE /dev/sd[abc]9

ARRAY /dev/md0 devices=/dev/sda5,/dev/sdb5,/dev/sdc5

ARRAY /dev/md1 devices=/dev/sda6,/dev/sdb6,/dev/sdc6

ARRAY /dev/md2 devices=/dev/sda7,/dev/sdb7,/dev/sdc7

ARRAY /dev/md3 devices=/dev/sda8,/dev/sdb8,/dev/sdc8

ARRAY /dev/md4 devices=/dev/sda9,/dev/sdb9,/dev/sdc9

fstab

/dev/sdb2		/boot		ext2		defaults,noatime		1 2

/dev/sda2		none		swap		sw			0 0

/dev/sdc2		none		swap		sw			0 0

/dev/md0		/		reiserfs		noatime			0 1

/dev/md1		/opt		reiserfs		noatime			0 0

/dev/md2		/usr		reiserfs		noatime			0 0

/dev/md3		/var		reiserfs		noatime			0 0

/dev/md4		/home		reiserfs		noatime			0 0

/dev/cdroms/cdrom0	/mnt/cdrom	auto		noauto,rw		0 0

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

proc			/proc		proc		defaults			0 0

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

grub.conf

default 0

timeout 30

splashimage=(hd1,1)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.13-r3

root (hd1,1)

kernel /kernel-2.6.13-gentoo-r4 root=/dev/sdb2 

title=Windows XP

rootnoverify (hd1,0)

makeactive

chainloader +1

----------

## NeddySeagoon

dlm1065,

This looks strange for a RAID system.

```
kernel /kernel-2.6.13-gentoo-r4 root=/dev/sdb2
```

root=/dev/md0 may work better.

----------

## dlm1065

 *NeddySeagoon wrote:*   

> dlm1065,
> 
> This looks strange for a RAID system.
> 
> ```
> ...

 

DOH!!   :Embarassed: 

Nothing like repeatedly typing something wrong to make 

you miss what you are doing thats stupid   :Embarassed: 

EDIT:

I read something to the effect that the /boot and the kernel

shouldn't reside on a Raid 5 software partition that

it could lead to instability was that just hot air???

I am still trying to learn the best ways for doing things in

linux. Still on 'n' in new to it. If you where doing this

how would you of broken the drive spaces up??

----------

## NeddySeagoon

dlm1065,

I wouldn't put /boot on a raid partition other than RAID1. Grub is not raid aware but RAID1 looks like a single (unmirroed) partition so grub is happy. I spent several gays trying to get grub to boot from kernel raid 0 before I twigged what was wrong.

I expect RAID5 would break grub for the same reason.

Edit

```
df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/md/1             9.2G  2.2G  6.6G  25% /

udev                  507M  384K  506M   1% /dev

/dev/md/2              56G   18G   35G  34% /usr

/dev/md/3             3.7G  955M  2.6G  27% /usr/local

/dev/md/4              12G  1.6G  9.0G  15% /tmp

/dev/md/5              30G   12G   17G  42% /var

/dev/md/6             440G   85G  333G  21% /home

none                  507M     0  507M   0% /dev/shm

eccles:/home          1.9G  908M  925M  50% /mnt/eccles

/dev/md/0              38M   19M   18M  52% /boot
```

Its all raid0 except /boot.

Swap is two seperate partitions at the same priority, managed by the kernel.

----------

