-   Gentoo (
-   -   Kernel panic after installing gentoo (

cristi92b 02-25-2012 09:19 AM

Kernel panic after installing gentoo
1 Attachment(s)
After installing gentoo using kernel 3.2.1-r2 without genkernel I got the following error message:

[ 2.352411] Kernel panic - not syncing: VFS: Unable to mount rootfs on unknown-block(2,0)
I guess I forgot to include some kernel modules.
Is there any way I can recompile the kernel without installing gentoo again? Do you know which modules I forgot to include?

fdisk -l /dev/sda


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
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9509763e

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13      32651  262160384    7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3          32651      112465  641105920    7  HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4          112465      121602    73392128    5  Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5  *      112465      112469      32768  83  Linux
/dev/sda6          112469      115131    21381120  83  Linux
/dev/sda7          115131      115196      524288  82  Linux swap / Solaris
/dev/sda8          115197      115201      32768  83  Linux
/dev/sda9          115201      117863    21381120  83  Linux
/dev/sda10        117863      117928      524288  82  Linux swap / Solaris
/dev/sda11        117928      117932      32768  83  Linux
/dev/sda12        117932      121536    28950528  83  Linux
/dev/sda13        121537      121602      523264  82  Linux swap / Solaris

Gentoo mountpoints:
/dev/sda5 is /boot
/dev/sda6 is /
/dev/sda7 is /swap

My grub.conf :

# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

default 0
timeout 30

title Windows 7
rootnoverify (hd0,0)
chainloader +1

title Gentoo Linux 3.2.1-r2
root (hd0,4)
kernel /kernel-3.2.1-gentoo-r2 ro root=/dev/sda6

title Arch Linux
root (hd0,10)
kernel /vmlinuz-linux root=/dev/sda12 ro vga=795
initrd /initramfs-linux.img

title Arch Linux Fallback
root (hd0,10)
kernel /vmlinuz-linux root=/dev/sda12 ro vga=795
initrd /initramfs-linux-fallback.img

title Slackware64 13.37
root (hd0,7)
kernel /vmlinuz-huge- root=/dev/sda9
initrd /config-huge-

title Slackware64 13.37 Failsafe
root (hd0,7)
kernel /vmlinuz-generic- root=/dev/sda9
initrd /config-generic-

#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5

# vim:ft=conf:


chrooted again using Gentoo CD and recompiled kernel (and copied bzImage to /boot) , but I get same error message. I uploaded kernel config file. Also, startx doesn't work:


(EE) Failed to load module "vesa"
(EE) Failed to load module "fbdev"

vesa and fbdev are included in USE flags.


I will come back after I will install it again.

syg00 02-25-2012 05:04 PM

genkernel uses an initrd. You will need one too unless you build all the required support to mount the root into the kernel (i.e. not as modules).
I've never used genkernel, and tended to use my own config. Means you doing the legwork for your box. Things are significantly easier these days - try "make localyesconfig".

cristi92b 02-25-2012 07:42 PM

So if I type "make localyesconfig" it will generate an initrd image?

syg00 02-25-2012 09:16 PM

No, it won't - perhaps you didn't read the bit after "unless".
"make --help" will list the options and a brief description. After that, a good search engine is invaluable - gentoo has always had good doco.

cristi92b 02-26-2012 06:10 AM

1 Attachment(s)
I recompiled the kernel and I included all the filesystems (not as modules) excepting the experimental ones. It still gives the same error, but now it loads nouveau before the kernel panic, see the picture I uploaded.


mount /dev/sda6 /mnt/gentoo
mount /dev/sda5 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
cd /usr/src/linux-3.2.1-gentoo-r1
make clean
make menuconfig
make localyesconfig
make && make modules_install
cp -L arch/x86_64/boot/bzImage /boot/kernel-3.2.1-gentoo-r1

/etc/fstab :


# /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/BOOT                /boot                ext2                noauto,noatime        1 2
/dev/ROOT                /                ext4                defaults,noatime                0 1
/dev/SWAP                none                swap                sw                0 0
/dev/cdrom                /mnt/cdrom        auto                noauto,ro        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

Thank you for your answers!

cristi92b 02-26-2012 01:57 PM

I forgot to include Nvidia SATA driver, now it works.

All times are GMT -5. The time now is 11:55 PM.