LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2006, 01:37 AM   #1
mellowmellow
LQ Newbie
 
Registered: Oct 2006
Distribution: Gentoo
Posts: 7

Rep: Reputation: 0
installing Gentoo: kernel can't mount root


Hi All,

I have installed Gentoo 2006.1, but I can't boot: while booting, the error message is
VFS: Cannot open root device "hda3" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I am still pretty new to Linux, so I am following the "HOWTO Install Gentoo Developers Method with NPTL and 2.6 from Stage1" guide ( I am not allowed to post links?) to walk through the process of installing Gentoo. I am learning a lot.

Now, I realize that what I describe is a common problem (searching on Google), the common points of failure are GRUB configuration and lack of built-in kernel support for devices and filesystems.

But I still can't figure it out. Here is what I am doing....

My partitions are
Root: /dev/hda3 (~20GB, ReiserFS file system)
Boot: /dev/hda6 (~750MB, ReiserFS file system)
Swap: /dev/hda7

my GRUB entry for Gentoo is
title Gentoo Linux
kernel /vmlinuz ro root=/dev/hda3


and I compiled my 2.6.17-gentoo-r8 kernel with built-in support for
  • Enhanced general ATA/IDE
  • IDE/ATA-2 DISK
  • IDE/ATAPI CDROM
  • SCSI disk
  • ReiserFS

My harddrive is a Maxtor IDE device connected to an ATA storage controller. I am not totally certain that my kernel options cover this (what other IDE-related options might I need?).

I also tried using an initrd file (built with mkinitrd, added an initrd line to GRUB), but still have the same problem. Is my GRUB configuration correct? Based on the error message, "Unable to mount root fs", is my problem more likely with the device or the filesystem?

I'm really stuck. Any guidance or comments will help.
 
Old 10-11-2006, 01:47 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,898

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Since you have boot in one partition, and root in another, you need to tell grub where they both are located.

change your current config:
title Gentoo Linux
kernel /vmlinuz ro root=/dev/hda3

to this:
title Gentoo Linux
kernel (hd0,5)/vmlinuz ro root=/dev/hda3

That tells grub that vmlinuz is in partition hda,6, and root is in partition hda,3.
 
Old 10-11-2006, 03:22 AM   #3
mellowmellow
LQ Newbie
 
Registered: Oct 2006
Distribution: Gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
Hi bigrigdriver, thanks for your reply. I tried
kernel (hd0,5)/vmlinuz ro root=/dev/hda3
and also tried separately specifying a "root", like this:
root (hd0,2)
kernel (hd0,5)/vmlinuz ro root=/dev/hda3

but all produce the same result (kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)). As I understand, (hd0,5)/vmlinuz and /vmlinuz are equivalent since the latter is relative to GRUB's boot partition.

Anything else I could try with the settings? I must be doing something wrong somewhere - where should I look?
 
Old 10-12-2006, 05:34 PM   #4
tp11235
Member
 
Registered: Feb 2005
Location: Somerset, England
Distribution: Gentoo
Posts: 106
Blog Entries: 1

Rep: Reputation: 15
I had the same problem. It was because I had not selected the correct IDE chipset during make menuconfig.

CHeck the options under ATA/ATAPI/MFM/RLL Support for your chipset. I am not sure why we are all getting the issue, maybe some old defaults are not defaults anymore.

You will also need the lines bigrigdriver shows you for your grub.conf.
 
Old 10-13-2006, 06:22 AM   #5
mellowmellow
LQ Newbie
 
Registered: Oct 2006
Distribution: Gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
Success - my gentoo kernel boots now. Thanks for the support!

A brief summary...
Problem: VFS: Cannot open root device "hda3" or unknown-block(0,0)
What was wrong: The kernel compile options were missing some necessary features but it wasn't obvious what those were.
The fix: Replace the kernel options with genkernel's defaults and go from there.

I will explain what I did, maybe this will help someone:
I suspected my kernel, so I made another kernel using the genkernel utility.
Code:
emerge genkernel
zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6
genkernel --menuconfig all
(I don't remember the purpose of the second line - I think it copies some configurations off of the LiveCD.) I setup to boot using genkernel's kernel, and it booted successfully. Thus the problem was indeed my kernel compile options.

For maximum compatibility, genkernel enables a lot of kernel compile options. But for performance, it is better tune them specifically for your system. Using genkernel's compile options as a starting point, I carefully adjusted them to my liking and built another kernel.
Code:
cd /usr/src/linux
make menuconfig
make && make modules modules_install install
The second line make menuconfig launches an interactive configuration program that lets you view and change your kernel options. When I did this, the customized kernel also boots successfully.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vmware gentoo - kernel panic with root fs - dont know why! flipwhy Linux - Newbie 12 09-23-2006 05:33 AM
compiling kernel problem --- Kernel panic: unable to mount root fs ........ anthonymts123 Linux - General 5 07-31-2006 03:29 AM
Possible solution to common "unable to mount root fs" kernel panic while installing pergesu Linux - Software 2 12-26-2005 04:11 PM
Cant mount root kernel 2.6.6 Kyl3 Slackware 10 05-23-2004 04:06 PM
LVM on root: Kernel Panic: Gentoo Sutekh Linux - General 2 08-17-2003 09:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration