# [solved] can't boot (cannot open root device)

## roelof

hello, 

One more try to make my own kernel but no succes.

On booting I get this messages :

```

ata 4: SATA link down (SStatus 0 Sontrol 310)

md : Waiting for all devices to be avaible before auto-detect

md : If you don't use Raid, use raid=noautodetect

md : Autodecting Raid Arrys

md : Scanned 0 en added 0 devices.

md : Autorun

md : .... autorun done

VFS : Cannot  open root device "813" or unknown-block (8,19)

Please append a correct "root=" boot option : here are the aviable options:

Kernel panic not syncing VFS : Unable to mountroot fs on unknown root fs on unknown block (8,19)

```

Fdisk -l gives this :

```

Disk /dev/sda: 82.3 GB, 82348277760 bytes

203 heads, 37 sectors/track, 21413 cylinders

Units = cylinders of 7511 * 512 = 3845632 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x08550854

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1       21414    80415744    7  HPFS/NTFS

Disk /dev/sdb: 61.5 GB, 61492838400 bytes

255 heads, 63 sectors/track, 7476 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x90909090

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *           1           5       40131   83  Linux

/dev/sdb2               6         267     2104515   82  Linux swap / Solaris

/dev/sdb3             268        7476    57906292+  83  Linux

Disk /dev/sdc: 750.2 GB, 750156374016 bytes

255 heads, 63 sectors/track, 91201 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0008490c

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1   *           1        3264    26218048+   7  HPFS/NTFS

/dev/sdc2            3265        6528    26218080    7  HPFS/NTFS

/dev/sdc3            6529       65272   471861180    7  HPFS/NTFS

/dev/sdc4           65273       91201   208274692+   7  HPFS/NTFS

```

my lilo.conf looks like this :

```

boot=/dev/sdb1

prompt

timeout=0

default=gentoo

image=/boot/kernel-2.6.31-gentoo-r10

   label=gentoo

   read-only

   root=/dev/sdb3

```

Fstab looks like this :

```

# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't 

# needed; notail increases performance of ReiserFS (at the expense of storage 

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

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

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/sdb1      /boot      ext2      noatime   1 2

/dev/sdb3      /      reiserfs      notail   0 1

/dev/sdb3      none      swap      sw      0 0

/dev/cdrom      /mnt/cdrom   auto      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

```

my kernel config can be found here : http://pastebin.com/U6DewxwP

Can anyone tell me where I gone wrong.

RoelofLast edited by roelof on Mon Apr 05, 2010 4:37 pm; edited 1 time in total

----------

## Jaglover

Did you install Lilo to sda? Did you change boot order in BIOS?

----------

## roelof

Hello Jaglover, 

No, I installed lilo to sdb. I use lilo to chainload Gentoo.

No, I did not change the boot order in Bios,

Only sdba can be found by bios.

Roelof

----------

## Jaglover

How do you load Lilo from sdb, BIOS boots the first drive. Do you have another bootloader on sda?

----------

## roelof

Yes, 

I use the Windows 7 bootloader to chainload lilo.

Roelof

----------

## Jaglover

 *Quote:*   

> Kernel panic not syncing VFS : Unable to mountroot fs on unknown root fs on unknown block (8,19) 

 

Well, let's sum it up. The above states kernel is trying to access sdb3, which would be correct. Also it tells us your kernel has HDD controller support. Looking at your .config you have reiser enabled. Should work! But it doesn't. The only thing I can come up with is your kernel is trying to access wrong drive.

Are all three drives SATA? Connected to the same controller? Your kernel may identify drives differently.

----------

## roelof

Hello Jaglover, 

I have three drives.

sda - Windows drive

sdb - my dvd burner.

sdc - Linux drive.

I think that sda and sdc uses the same controller.

sdb is on a different controller.

Can i verify this without opening the computer cover.

Roelof

----------

## gerard27

In your kernel .config I came across this line

```

# CONFIG_EXT2_FS is not set
```

According to your /etc/fstab /boot is ext2.

Gerard.

----------

## Jaglover

Well, It may be your kernel has no support for another controller, thus your kernel may identify sdb as sda. I'd try root=sda3

@gerard82

There is no reason kernel should have ext2 support, kernel does not need to read /boot, it's what bootloader does. You won't be able to access /boot from your OS once it's up, indeed. But you can boot.Last edited by Jaglover on Fri Apr 02, 2010 2:58 pm; edited 1 time in total

----------

## gerard27

And in your fstab

```

/dev/sdb3      /      reiserfs      notail   0 1

/dev/sdb3      none      swap      sw      0 0 
```

Of course swap should be /dev/sdb2.

Gerard.

----------

## gerard27

@Jaglover,

Yes,but it won't be fsck'ed.

Gerard.

----------

## Jaglover

 *gerard82 wrote:*   

> @Jaglover,
> 
> Yes,but it won't be fsck'ed.
> 
> Gerard.

 

True.  :Smile: 

I have ext2 built as module, it wont be loaded unless I mount /boot to upgrade my kernel.

----------

## gerard27

 *roelof wrote:*   

> Hello Jaglover, 
> 
> I have three drives.
> 
> sda - Windows drive
> ...

 

Well now this really is confusing!

Gerard.

----------

## roelof

Oke, 

So changed my fstab and put ext2 in the kernel.

Do i understand that part ?

Roelof

----------

## gerard27

Can you boot now?

Gerard.

----------

## roelof

Hello Gerard, 

Nope, stil the same error message.

Roelof

----------

## Jaglover

 *roelof wrote:*   

> Oke, 
> 
> So changed my fstab and put ext2 in the kernel.
> 
> Do i understand that part ?
> ...

 

fstab is not read before / is mounted, obviously - and mounting fails. And ext2 in kernel is not needed for booting, although /boot is on ext2.

Did you try what I suggested, root=sda3 in Lilo, don't forget to re-run lilo after modification.

 *roelof wrote:*   

> Hello Jaglover, 
> 
> I have three drives.
> 
> sda - Windows drive
> ...

 

This is confusing indeed, maybe root=sdc3 would be the correct option. You didn't install Gentoo to a DVD ... I guess?

----------

## roelof

Hello.

If I do root=sda3 then I get this message : Fatal: Illegal 'root=' specification: /dev/sda3

If I try root=sdc3 then I get this message : Fatal: raid_setup: stat("/dev/sdc1")

So sdb3 schould be good.

And I don't install Gentoo to a dvd.

Roelof

Edit : when I do /sbin/lilo -v I get this messages : 

LILO version 22.8, Copyright (C) 1992-1998 Werner Almesberger

Development beyond version 21 Copyright (C) 1999-2006 John Coffman

Released 19-Feb-2007 and compiled at 18:02:24 on Mar 31 2010

Warning: LBA32 addressing assumed

Reading boot sector from /dev/sdb1

Warning: /dev/sdb1 is not on the first disk

Using MENU secondary loader

Calling map_insert_data

Boot image: /boot/kernel-2.6.31-gentoo-r10

Added gentoo *

Writing boot sector.

/boot/boot.0811 exists - no boot sector backup copy made.

----------

## Jaglover

So sdb is not your DVD drive? You really should clear up this drive naming thing.

----------

## Jaglover

 *Quote:*   

> Reading boot sector from /dev/sdb1 

 

It has been long time since I used Lilo ... are you installing Lilo to sdb or sdb1? Normally you should install to MBR.

----------

## roelof

Hello, 

I think that lilo don't count the dvd burner as disk.

So sdb is the disk where gentoo is installed.

I install lilo to sdb1 so the Windows boot loader can find it.

Roelof

----------

## roelof

Anyone any idea ?

Roelof

----------

## pappy_mcfae

While I am not absolutely sure that this is the source of your issue, ext2 support is not turned on in the kernel. Not a good thing if you are declaring an ext2 drive in /etc/fstab. If you are going to use ext2, you have to support it in the kernel, even if it is for the /boot directory. 

You do have ext3 support set up in the kernel. Was /boot actually formatted ext3? If so, you would have to change /etc/fstab to reflect that reality.

Also, there is a lot of kruft in your current kernel .config. Send the results of lspci -n, and I'll see if we can trim your kernel .config to see if that helps this issues.

Cheers,

Pappy

----------

## roelof

Hello Pappy, 

I put ext2 in the kernel but that didn't solve the problem.

Wierd that there is a lot of kruft in my .config. I took a config from your kernel seeds and change only what lspci tells me to change.

But here's the putput of lspci -n :

```

00:00.0 0600: 1002:5950 (rev 10) 

00:02.0 0604: 1002:5a34 

00:11.0 0101: 1002:437a (rev 80) 

00:12.0 0101: 1002:4379 (rev 80) 

00:13.0 0c03: 1002:4374 (rev 80) 

00:13.1 0c03: 1002:4375 (rev 80) 

00:13.2 0c03: 1002:4373 (rev 80) 

00:14.0 0c05: 1002:4372 (rev 81) 

00:14.1 0101: 1002:4376 (rev 80) 

00:14.2 0403: 1002:437b (rev 01) 

00:14.3 0601: 1002:4377 (rev 80) 

00:14.4 0604: 1002:4371 (rev 80) 

00:18.0 0600: 1022:1100 

00:18.1 0600: 1022:1101 

00:18.2 0600: 1022:1102 

00:18.3 0600: 1022:1103 

01:00.0 0300: 10de:01d1 (rev a1) 

02:03.0 0200: 10ec:8139 (rev 10) 

02:04.0 0c00: 1106:3044 (rev 80) 

```

Roelof

----------

## Gentoo4Work

Your problem looks similar to one that I had a while back, though your setup is radically different than mine, so YMMV.

Try building the RAID drivers as modules, and specifying them in the autoload directory, instead of building them statically with the kernel.  The problem I had was that initialization of the RAID upon reboot was messing up my drive numbering.  I don't know a thing about low-level bootstrapping so I'm not going to speculate about what was screwing with what, but building the RAID driver as an autoload module fixed the problem for me.

----------

## roelof

Hello Gentoo4Work,

I just can disable the RAID drivers I think because I don't use RAID.

First find out where the RAID drivers are hidden in the config.

So thanks for the tip.

Roelof

----------

## Gentoo4Work

I may be totally wrong, but I don't think it works that way.  The .config is just a blueprint or template inhereted by the make process.  You still have to rebuild the kernel.  Changing the option in the .config or config.cz will only change whether or not it's selected by default when you do a 'make menuconfig'.  I'm definitely pulling all of this out of my behind, but think about it... if the kernel needed to reference .config for EVERYTHING, then you'd be in a lot of trouble before it even managed to mount the root partition that the file's located on.

As a rule of thumb, don't include crap in the kernel that you don't need.  Except encryption stuff.  I always statically include any encryption options that aren't marked (NEW!!!!1, EXPERIMENTAL, or DANGEROUS).  Just because you never know when you're going to come task that or program that uses an algorithm that you could've added native hardware acceleration for at the cost of 2k or whatever.  Back around 8.10 or 9.04 the ubuntu folks started making a fuss over having phoronix performance statistics several orders of magnitude better than a gentoo test box running the 'same' kernel in the domain of compression / encryption, and I'd bet dollars to doughnuts that's what changed from 8.04 to 8.10.

Stuff that you need-on-demand, just write a bash-script that loads the necessary kernel module before starting the program, and then use that as the program launcher, instead of the program launcher itself.  Just make sure you keep it up-to-date if names or environments change.

----------

## roelof

Oke, 

That's what I ment.

Using menuconfig for excluding RAID stuff.

For a config I use kernel seeds and then include my own things to the config.

Roelof

----------

## pappy_mcfae

Having completely checked the .config you sent, there is no way that could have sprung from one of my seeds. I know my product well, and that wasn't it.

However, this is a bit closer to a seed. I checked, and I didn't have a cat /proc/cpuinfo file on you, so I left your processor as the generic default. I suggest you change that once things get sorted out.

Another thing. I don't know if anyone noted it yet, but in your /etc/fstab, /dev/sdb3 appears to be both your / drive and your swap partition. 

```
/dev/sdb3      /      reiserfs      notail   0 1   <---

/dev/sdb3      none      swap      sw      0 0  <---
```

If this is still the case, you need to make sure that your /etc/fstab reflects your TRUE drive partition scheme. Somehow, I don't think you can use a Linux partition and a Linux swap partition interchangeably...especially at the same time.

Cheers,

Pappy

----------

## roelof

Hello Pappy, 

I unmerged the kernel-sources and zen-sources

Cleaned up the directories.

And re-emerged the kernel-sources.

And now it works.

The only things are :

1) Cannot read  /etc/ntp.conf : No such file or directory.

2) Udevd : cannot read /etc/udev/rules.d/70-persisent-cd-rules.

3) The box gets a ip-adres but DNS is not working.

Roelof

----------

## pappy_mcfae

 *roelof wrote:*   

> 
> 
> 1) Cannot read  /etc/ntp.conf : No such file or directory.

 

Here is mine:

```
# NOTES:

# DHCP clients can append or replace NTP configuration files.

# You should consult your DHCP client documentation about its

# default behaviour and how to change it.

# Name of the servers ntpd should sync with

# Please respect the access policy as stated by the responsible person.

#server      ntp.example.tld      iburst

# Common pool for random people

#server pool.ntp.org

# Pools for Gentoo users

server 0.gentoo.pool.ntp.org

server 1.gentoo.pool.ntp.org

server 2.gentoo.pool.ntp.org

server 3.gentoo.pool.ntp.org

##

# A list of available servers can be found here:

# http://www.pool.ntp.org/

# http://www.pool.ntp.org/#use

# A good way to get servers for your machine is:

# netselect -s 3 pool.ntp.org

##

# you should not need to modify the following paths

driftfile   /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer 

#server timeserver.example.org 

# Warning: Using default NTP settings will leave your NTP

# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)

# from accessing the NTP server, uncomment:

#restrict default ignore

# To deny other machines from changing the

# configuration but allow localhost:

restrict default nomodify nopeer

restrict 127.0.0.1

# To allow machines within your network to synchronize

# their clocks with your server, but ensure they are

# not allowed to configure the server or used as peers

# to synchronize against, uncomment this line.

#

#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap

```

 *Quote:*   

> 2) Udevd : cannot read /etc/udev/rules.d/70-persisent-cd-rules.

 

This may be caused by invoking the optical drive via /etc/fstab.  In general, when working with X, getting the CD/DVDROM drive to automount is the job of hal/dbus.

I would also emerge udev again to reset its files. While this shouldn't be necessary, as /etc/udev/rules.d/70-persisent-cd-rules rewrites itself at each boot cycle, it is covering another base that might be the cause.

 *Quote:*   

> 3) The box gets a ip-adres but DNS is not working.
> 
> Roelof

 

/etc/resolv.conf:

```
nameserver 8.8.4.4

nameserver 8.8.8.8

nameserver 192.168.0.1
```

Note that the first two nameservers are google's public DNS servers. I use them because the DNS numbers that come with my Internet connection are slower than the public ones I listed. The last line should be the same as your gateway number. While this is more or less unneeded, there are some packages that like having the gateway invoked as a DNS server.

Hope that helps.

Cheers,

Pappy

----------

## roelof

Hello Pappy, 

Putting the name servers in resolv.conf is not working,

DHCP is overwritting it every boot.

Mike is helping me here with that problem : https://forums.gentoo.org/viewtopic-t-822219.html

Roelof

----------

## pappy_mcfae

That's true. DHCPCD rewrites /etc/resolv.conf. If you use a static IP address, that issue goes away. But since you have someone else on the hook for that one, I'll just say...

Cheers,

Pappy

----------

