# Problem booting into new kernel [Solved]

## Zeerak

Hey guys,

I thought I'd go for a change and decided to try out one of Pappy's tuxonice seeds but I'm getting a kernel panic on boot.

It says that VFS can't find the root device (on block (8,5) while the working image finds the root device on 8:5) and to specify the correct root device. I've got a working kernel with the previous kernel version (with the same arguments passed in grub.conf). 

I've gone through the parts that I thought would make sense (device drivers and filesystems) but they both are identical on that bit.

Any help would be much appreciated. And let me know if you'd like the old .config as well.

The new config is here:

http://paste.pocoo.org/show/312338/

output of lspci -n:

```
00:00.0 0600: 8086:2a00 (rev 0c)

00:01.0 0604: 8086:2a01 (rev 0c)

00:1a.0 0c03: 8086:2834 (rev 03)

00:1a.1 0c03: 8086:2835 (rev 03)

00:1a.7 0c03: 8086:283a (rev 03)

00:1b.0 0403: 8086:284b (rev 03)

00:1c.0 0604: 8086:283f (rev 03)

00:1c.1 0604: 8086:2841 (rev 03)

00:1c.2 0604: 8086:2843 (rev 03)

00:1c.3 0604: 8086:2845 (rev 03)

00:1d.0 0c03: 8086:2830 (rev 03)

00:1d.1 0c03: 8086:2831 (rev 03)

00:1d.2 0c03: 8086:2832 (rev 03)

00:1d.7 0c03: 8086:2836 (rev 03)

00:1e.0 0604: 8086:2448 (rev f3)

00:1f.0 0601: 8086:2815 (rev 03)

00:1f.1 0101: 8086:2850 (rev 03)

00:1f.2 0106: 8086:2829 (rev 03)

00:1f.3 0c05: 8086:283e (rev 03)

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

04:00.0 0280: 8086:4230 (rev 61)

06:00.0 0200: 14e4:1713 (rev 02)

08:06.0 0c00: 1180:0832 (rev 05)

08:06.1 0805: 1180:0822 (rev 22)

08:06.2 0880: 1180:0843 (rev 12)

08:06.3 0880: 1180:0592 (rev 12)

08:06.4 0880: 1180:0852 (rev 12)

```

Grub.conf:

```
title Gentoo Linux Test Kernel

root (hd0,0)

kernel /boot/tuxonice-2.6.36-r4 resume=swap:/dev/sda3

title Gentoo Linux (Tux On Ice) 2.6.36

root (hd0,0)

kernel /boot/tuxonice-2.6.36 resume=swap:/dev/sda3

title Gentoo Linux 2.6.36 (Rescue)

# Partition where the kernel image (or operating system) is located

root (hd0,0)

kernel /boot/tuxonice-2.6.36 root=/dev/sda5 init=/bin/bb

```

Output of grub-install /dev/sda:

```
 grub-install /dev/sda

Installation finished. No error reported.

This is the contents of the device map /boot/grub/device.map.

Check if this is correct or not. If any of the lines is incorrect,

fix it and re-run the script `grub-install'.

(hd0)   /dev/sda

(hd1)   /dev/sdb

```

and finally my /etc/fstab

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

/dev/sda1               /boot                           ext2            noauto,noatime  1 2

#/dev/sda2              /mnt/windows                    none            noauto          0 2

# /dev/sda2 = windows partition

/dev/sda3               none                            swap            sw              0 0

/dev/sda5               /                               jfs             defaults        0 1

/dev/sda14              /home                           jfs             defaults        0 0

/dev/sda6               /usr                            jfs             defaults        0 0

/dev/sda9               /usr/src                        reiserfs        defaults        0 0

/dev/sda10              /var                            reiserfs        defaults        0 0

/dev/sda7               /var/portage                    reiserfs        defaults        0 0

/dev/sda8               /var/portage/distfiles          ext2            defaults        0 0

/dev/sda11              /var/tmp                        reiserfs        defaults        0 0

/dev/sda12              /opt                            jfs             defaults        0 0

/dev/sda13              /tmp                            ext2            defaults        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

```

----------

## The Doctor

well, the config looks right. Is the driver for your root files system built into the kernel? Or might the hard drive settings in the kernel be at fault? JFS gave me a fair bit of irritation.

----------

## Zeerak

Yup all filesystem drivers are built into the kernel.

The most likely thing I can come up with is that the hard drive settings in the kernel are at fault, but having compared the working .config and the failing, there doesn't seem to be a difference between the two in that section.

----------

## The Doctor

Grub might be the problem. check the handbook here http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10 for information about JFS and grub.

If that fails, try running lspci and searching for the hard drive option that matches. This is probably a long shot, but it is what kept me on genkernel for around 9 months.   :Embarassed: 

My best guess at this point would be that thing with grub and JFS though.

----------

## Zeerak

It shouldn't have anything to do with my root partition as such as the partition question is a separate boot partition which is ext2. So that it might be JFS should be out the window. I must have disabled something along the way of updating...

----------

## Hu

Since the kernel mentions (8,5), it found some sort of hard drive that it understands and mapped to sda5.  Your grub-install output mentions two hard drives.  Is it possible that you lost support for the main hard drive, so that the kernel only discovers the secondary hard drive?  I think that would cause it to assign sda names to the drive it found, which would likely fail if that drive (which is normally sdb) is not a bootable system of its own.

----------

## Zeerak

The problem is that I'm using a laptop that only has one harddrive.

Output of ls /dev/sd*:

```
 ls /dev/sd*

/dev/sda  /dev/sda1  /dev/sda10  /dev/sda11  /dev/sda12  /dev/sda13  /dev/sda14  /dev/sda2  /dev/sda3  /dev/sda5  /dev/sda6  /dev/sda7  /dev/sda8  /dev/sda9
```

----------

## VoidMage

How many partitions are on that disk ?

Mind, I'm not asking about /dev/ count, but 'fdisk -l' (or something at least as close to partition table).

Also, post the old kernel config too, the one, that was working.

----------

## Zeerak

Woot new help!

Here's the old .config http://paste.pocoo.org/show/312916/

and fdisk -l /dev/sda:

```
Caemlyn Tmp # fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes

255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors

Units = sectors of 1 * 512 = 512 bytes

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

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

Disk identifier: 0x00082061

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *          63      192779       96358+  83  Linux

/dev/sda2         6185025   234436544   114125760    5  Extended

/dev/sda3          192780     6185024     2996122+  82  Linux swap / Solaris

/dev/sda5         6185088    14185394     4000153+  83  Linux

/dev/sda6        14185458    30186134     8000338+  83  Linux

/dev/sda7        30186198    36178379     2996091   83  Linux

/dev/sda8        36178443    54171179     8996368+  83  Linux

/dev/sda9        54171243    58171364     2000061   83  Linux

/dev/sda10       58171428    60163424      995998+  83  Linux

/dev/sda11       60163488    80164349    10000431   83  Linux

/dev/sda12       80164413    88164719     4000153+  83  Linux

/dev/sda13       88164783    89915804      875511   83  Linux

/dev/sda14      134431983   234436544    50002281   83  Linux

```

----------

## NeddySeagoon

Zeerak,

Do you have some external storage attached at boot dime ?

That can mess up the BIOS drive discovery order.

Boot the old kernel and post the output of 

```
df -T
```

I'm particulary interested in  /dev/sda1 and in /dev/sda5

While you are there, post

```
ls -l /boot
```

both with boot mounted  and /boot not mounted.

----------

## Zeerak

Hey Neddy,

Nope don't have anything attached. Aaaand here's the info you asked for.

df -T:

```
 df -T

Filesystem    Type   1K-blocks      Used Available Use% Mounted on

rootfs      rootfs     3983440    621776   3361664  16% /

/dev/root      jfs     3983440    621776   3361664  16% /

rc-svcdir    tmpfs        1024        84       940   9% /lib64/rc/init.d

udev         tmpfs       10240       308      9932   4% /dev

shm          tmpfs     1023496         0   1023496   0% /dev/shm

/dev/sda14     jfs    49967780  36940884  13026896  74% /home

/dev/sda6      jfs     7968144   6852996   1115148  87% /usr

/dev/sda9 reiserfs     1999932   1702828    297104  86% /usr/src

/dev/sda10

          reiserfs      995932    798080    197852  81% /var

/dev/sda7 reiserfs     2995936    452900   2543036  16% /var/portage

/dev/sda8     ext2     8854984   3507868   4897300  42% /var/portage/distfiles

/dev/sda11

          reiserfs    10000072   3459688   6540384  35% /var/tmp

/dev/sda12     jfs     3983440    355704   3627736   9% /opt

/dev/sda13    ext2      861728      1400    816556   1% /tmp

/dev/sda1     ext2       93307     13057     75433  15% /boot

```

and ls -l /boot (mounted):

```
# ls -l /boot/

total 11073

lrwxrwxrwx 1 root root       1 Mar 31  2010 boot -> .

drwxr-xr-x 2 root root    1024 Dec 31 04:12 grub

drwx------ 2 root root    1024 Mar 30  2010 lost+found

-rw-r--r-- 1 root root 6736080 Dec 20 14:43 tuxonice-2.6.36

-rw-r--r-- 1 root root 4552480 Dec 31 02:42 tuxonice-2.6.36-r4

```

ls -l /boot (unmounted):

```
ls -l /boot/

total 0

```

----------

## NeddySeagoon

Zeerak,

# CONFIG_BLK_DEV_BSG is not set is probably a bad thing but probably not the cause of your troubles.

It enables lots of go faster options for drives that can take advantage of them.

When you installed grub, your system had two drives attached, as is shown by your /boot/grub/device.map

```
kernel /boot/tuxonice-2.6.36-r4 resume=swap:/dev/sda3 
```

Is a little odd but the root=/dev/sda3 should be built into the kernel if it was complied on that system.  You really don't want to attempt a resume on top of a different kernel.

At the grub screen, press 'e'

Navigate to the 

```
title Gentoo Linux Test Kernel

root (hd0,0)

kernel /boot/tuxonice-2.6.36-r4 resume=swap:/dev/sda3 
```

stanz and change the root (hd0,0) to read root (hd then press tab.

Grub will list the drives it sees or fill in the 0 if there is only one. Restore the root (hd0,0) unless grub sees two (or more) drives.

----------

## Zeerak

The interesting thing is though that I didn't have two mediums connected. I've always wondered where my device.map found that second drive as a regular running system never found it. As a test I just tried to run grub-install again (I don't have anything connected right now) but got two drives as well.

Not sure what you mean about the root=/dev/sda3 as sda3 is my swap partition... sda5 is my root partition and sda1 is boot.

I tried editing during boot but root (hd[tab],[tab]) gave 0 and my partitions, boot being the first one on the list.

Oh and took a picture of the boot message and here's the transcription:

```

TuxOnIce: Can't translate "/dev/sda3" into a device id yet.

Root-NFS: No NFS-server available, giving up.

VFS: Unable to mount root via NFS, trying floppy

VFS: Cannot open root device /dev/sda1 or unknown block (2,0)

Please append a correct "root=" boot option; here are the available partitions:

0b00    1048575 sr0 driver: sr

Kernel panic - not syncing: VFS: Unable to mount rootfs on unknown block(2,0)

Pid: 1, comm: swapper Not tainted 2.6.36-tuxonice-r4 #4

Call Trace:

? panic+0x9c/0x199

? printk+0x40/0x45

? mount_block_root+0x145/0x1e7

? prepare_namespace+0x13a/0x164

? kernel_init+0x1b4/0xc0

? kernel_thread_helper+0x4/0x10

? kernel_init+0x0/0x1c0
```

I don't know why it's trying to mount via nfs without attempting to mount on disk first. But I hope this helps a bit more.

----------

## VoidMage

Now that you've mentioned it, do try adding explicit root= option to grub kernel line.

----------

## NeddySeagoon

Zeerak,

That /dev/sda3 is a typo on my part. root=/dev/sda5 would be better.

```
TuxOnIce: Can't translate "/dev/sda3" into a device id yet. 
```

is rather worrying.

It suggests it can't translate /dev/sda5 either. 

We will know more when it try the explicit root=

----------

## Hu

 *Zeerak wrote:*   

> 
> 
> ```
> Root-NFS: No NFS-server available, giving up.
> 
> ...

 Based on the output after the "Please append" line, it cannot find your hard disk.  Thus, it fell back to trying NFS and floppy.  You should probably remove support for booting over NFS if you do not need it.

----------

## Zeerak

Hey guys, here's an picture from using root=/dev/sda5 http://ompldr.org/vNnRpZw

Just trying to boot into a system without NFS support.

----------

## jburns

You could do a lspci -k to see what drivers are being used by the kernel that boots.

You could try setting CONFIG_SATA_AHCI in the new kernel .config

----------

## NeddySeagoon

Zeerak,

... cannot open root device ... means that the driver for the HDD chipset is missing from your kernel.

or maybe you have both the old and new drivers built.  Then neither work.

----------

## Zeerak

Wohoooo!

Found the error! 

Or jburns did. The missing option was CONFIG_SATA_AHCI. Writing from the new kernel now! Thanks everyone!

----------

