Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to fix 'Kernel panic: VFS: Unable to mount root fs'
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Fri Jan 09, 2004 8:40 am    Post subject: How to fix 'Kernel panic: VFS: Unable to mount root fs' Reply with quote

There have been much discussion on how to fix this. This summarizes some of the tips given so far in these discussions. Note that this error has nothing to do with /etc/fstab! If the kernel can't mount the root file system, then there's no way it can read /etc/fstab. This is purely a kernel configuration problem.

Fix your kernel boot parameters.

Make sure your kernel has a "root=" parameter passed to it in your bootloader and that the parameter points to your root file system. For example, my root file system is on /dev/hde2. My grub.conf contains:
Code:
kernel (hd0,0)/boot/bzImage-2.6.1-rc2-gentoo-1 root=/dev/hde2

If you use LILO, then your lilo.conf should contain something analogous to:
Code:
image=/boot/bzImage-2.6.1-rc2-gentoo-1
root=/dev/hde2

Remember to rerun lilo after editing lilo.conf!

If you don't know which partition is your root, then check /etc/fstab and look for the entry for / :
Code:
/dev/hde2               /               reiserfs        noatime         1 2


Ensure the proper options and drivers are built into the kernel.

Don't forget to mount /boot when installing a new kernel!

devfs support
You need devfs support built in and mounted at boot time. In the 2.6 kernel, these are listed as:
Code:
File systems
 -> Pseudo file systems
 -> /dev file system support (OBSOLETE)   DEVFS_FS
   -> Automatically mount at boot         DEVFS_MOUNT

In the 2.4 kernel, they are:
Code:
File systems
 -> /dev file system support (EXPERIMENTAL)
      Automatically mount at boot


File system support
You need support for your root file system built in (not built as a module). My root file system is Reiser. So I have reiserfs built into my kernel. If you are unsure what your root file system is, check /etc/fstab.


Drive controller support
You need supoort for your drive controller built into the kernel. If you are unsure what to build, check with `lspci', part of the sys-apps/pciutils package. If all else fails, build them all and use the process of elimination.

IDE
Make sure you have support for your IDE chipset compiled in. In the 2.6 kernel, these can be found in
Code:
Device Drivers
 -> ATA/ATAPI/MFM/RLL support
 -> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
 -> PCI IDE chipset support
 -> Generic PCI bus-master DMA support

For the 2.4 kernel, they are in
Code:
ATA/IDE/MFM/RLL support
 -> IDE, ATA and ATAPI Block devices
 -> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
 -> Generic PCI IDE chipset support

You also need "Include IDE/ATA-2 DISK support" built in. This can be found in the "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" branch of the kernel configuration menu.

SCSI
Make sure you have support for your SCSI device compiled in. In the 2.6 kernel,
Code:
Device drivers
 -> SCSI device support
 -> SCSI low-level drivers

In the 2.4 kernel,
Code:
SCSI support
 -> SCSI low-level drivers

You also need "SCSI disk support" built in. This can be found in the "SCSI [device] support" branch of the kernel configuration menu.


Partition selection support
If you partitioned your drive under a different operating system, you may need to enable partition selection support in the kernel. In both the 2.4 and 2.6 kernels,
Code:
File systems
 -> Partition types
 -> Advanced partition selection
Back to top
View user's profile Send private message
Tii
l33t
l33t


Joined: 02 Jan 2004
Posts: 733

PostPosted: Fri Jan 09, 2004 8:52 am    Post subject: Re: HOWTO fix 'Kernel panic: VFS: Unable to mount root fs' Reply with quote

That's a good list!
Tazmanian wrote:

devfs support
You need devfs support built in and mounted at boot time. In the 2.6 kernel, these are listed as:
Code:
File systems
 -> Pseudo file systems
 -> /dev file system support (OBSOLETE)   DEVFS_FS
   -> Automatically mount at boot         DEVFS_MOUNT

In the 2.4 kernel, they are:
Code:
File systems
 -> /dev file system support (EXPERIMENTAL)
      Automatically mount at boot


However, I am using 2.6 kernel and don't have
Code:
-> Automatically mount at boot

What do I need that for?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Fri Jan 09, 2004 9:00 am    Post subject: Re: HOWTO fix 'Kernel panic: VFS: Unable to mount root fs' Reply with quote

Derryth wrote:
That's a good list!

Thanks! :)

Derryth wrote:
However, I am using 2.6 kernel and don't have
Code:
-> Automatically mount at boot

What do I need that for?

I'm not sure, but I'm guessing that if I have "root=/dev/hde2" as a boot parameter, then the kernel needs /dev mounted at boot time to translate "/dev/hde2" into the proper node address.

It's also part of the Gentoo installation guide (Sec. 7, Code listing 6).
Back to top
View user's profile Send private message
Tii
l33t
l33t


Joined: 02 Jan 2004
Posts: 733

PostPosted: Fri Jan 09, 2004 9:02 am    Post subject: Re: HOWTO fix 'Kernel panic: VFS: Unable to mount root fs' Reply with quote

Tazmanian wrote:

Derryth wrote:
However, I am using 2.6 kernel and don't have
Code:
-> Automatically mount at boot

What do I need that for?

I'm not sure, but I'm guessing that if I have "root=/dev/hde2" as a boot parameter, then the kernel needs /dev mounted at boot time to translate "/dev/hde2" into the proper node address.

It's also part of the Gentoo installation guide (Sec. 7, Code listing 6).

I didn't even have devfs support at first because I though I didn't need it (it says it's obsolete in the setup). It worked just fine except every time at boot it would complain so I added that.
Back to top
View user's profile Send private message
Cheesepie
Apprentice
Apprentice


Joined: 19 Jan 2004
Posts: 154
Location: 66.159.250.108

PostPosted: Tue Jan 20, 2004 7:29 am    Post subject: Reply with quote

I checked and triple checked all of the above solutions to the kernel panic problem, and Im still getting it.

I am absolutely sure that the filesystem and controller are compiled into the kernel.

Im using 2.6.1, btw.

any other ideas?
===============
Problem Solved: I replaced the SATA cable on the drive and it works now. The cable seems to work in another machine, so it must have been making a bad connection with the drive or something.
_________________
Cheesepie.org - the cheesiest place on the web: an off topic forum with lots of tasty goodness
Back to top
View user's profile Send private message
smellycheeseboy
Apprentice
Apprentice


Joined: 15 May 2003
Posts: 263
Location: The Future

PostPosted: Tue Jan 20, 2004 9:15 am    Post subject: Reply with quote

I also checked and triple-checked all the settings and they were all right and I am still getting this error.

Help would be greatly appreciated.

Me
_________________
"No amount of fear can stop the rise of free media, or free software." --Jonathan Schwartz, Sun Microsystems
Back to top
View user's profile Send private message
Corw|n of Amber
Apprentice
Apprentice


Joined: 08 Aug 2003
Posts: 221
Location: Socialist Sovietic Republic of Belgium

PostPosted: Tue Jan 20, 2004 3:51 pm    Post subject: Reply with quote

Remove the initrd line in your grub.conf should get rid of that error. It's a highly irritating genkernel bug (or maybe combination_of_reiserfs+2.6+grub bug).

I'm pretty sure that would cure your computer as it did mine...
_________________
Whoever is enough of a fanatic to KILL people should be shot on sight.
Back to top
View user's profile Send private message
smellycheeseboy
Apprentice
Apprentice


Joined: 15 May 2003
Posts: 263
Location: The Future

PostPosted: Tue Jan 20, 2004 9:04 pm    Post subject: Reply with quote

I don't have an initrd line because I didn't use genkernel. However I found that adding a notail option to my root partition (which is reiserfs) fixed the problem.

Me
_________________
"No amount of fear can stop the rise of free media, or free software." --Jonathan Schwartz, Sun Microsystems
Back to top
View user's profile Send private message
Corw|n of Amber
Apprentice
Apprentice


Joined: 08 Aug 2003
Posts: 221
Location: Socialist Sovietic Republic of Belgium

PostPosted: Tue Jan 20, 2004 9:14 pm    Post subject: Reply with quote

Oh. Yes. Forgot that one. Sorry :oops:
_________________
Whoever is enough of a fanatic to KILL people should be shot on sight.
Back to top
View user's profile Send private message
smellycheeseboy
Apprentice
Apprentice


Joined: 15 May 2003
Posts: 263
Location: The Future

PostPosted: Tue Jan 20, 2004 9:22 pm    Post subject: Reply with quote

No prob. Thanks for the suggestions.
_________________
"No amount of fear can stop the rise of free media, or free software." --Jonathan Schwartz, Sun Microsystems
Back to top
View user's profile Send private message
secondshadow
Guru
Guru


Joined: 23 Jun 2003
Posts: 362

PostPosted: Wed Jan 21, 2004 5:16 am    Post subject: Reply with quote

Just to add my $0.02, the way I solved part of this problem was to use an experimental LiveCD (2.6) and pull its config from /proc/config.gz then strip out everything I didn't need. This fixed my problem and while its not the IDEAL solution, it works quite well.
Back to top
View user's profile Send private message
timmy334
n00b
n00b


Joined: 24 Sep 2003
Posts: 69
Location: Montgomery, AL

PostPosted: Thu Jan 22, 2004 5:53 pm    Post subject: IRQ scan failed Reply with quote

I've always gotten this kernel panic and I just saw that when it's booting it does an IRQ scan for all my drives, and when it gets to hda(my drive) the scan doesn't find anything. Any idea what is causing this specifically?
_________________
It is by caffeine alone I set my mind in motion,
It is by the beans of Java my thoughts acquire speed,
My hands acquire shaking, the shaking becomes a warning,
It is by caffeine alone I set my mind in motion
Back to top
View user's profile Send private message
allancairns
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 80
Location: Perth, Western Australia

PostPosted: Sun Jan 25, 2004 1:26 am    Post subject: Reply with quote

Getting it here too on a 2.6.1 upgrade using genkernel.

I use reiserfs for my root (pattern?) but already have the notail option in fstab.

I double-checked my grub.conf for the root= and tried commenting out the initrd but no luck.

Any other ideas?

Thanks,

Allan
Back to top
View user's profile Send private message
allancairns
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 80
Location: Perth, Western Australia

PostPosted: Sun Jan 25, 2004 1:12 pm    Post subject: Reply with quote

allancairns wrote:
Getting it here too on a 2.6.1 upgrade using genkernel.

I use reiserfs for my root (pattern?) but already have the notail option in fstab.

I double-checked my grub.conf for the root= and tried commenting out the initrd but no luck.

Any other ideas?

Thanks,

Allan


This thread http://forums.gentoo.org/viewtopic.php?p=805230 fixed mine. The syntax of grub for 2.6 is totally different from 2.4.

Cheers,

Allan
Back to top
View user's profile Send private message
cchee
Apprentice
Apprentice


Joined: 29 Jul 2003
Posts: 214
Location: NYC

PostPosted: Sun Jan 25, 2004 9:26 pm    Post subject: Reply with quote

Read the /usr/share/genkernel/README
Back to top
View user's profile Send private message
Suicidal
l33t
l33t


Joined: 30 Jul 2003
Posts: 940
Location: /dev/null

PostPosted: Sun Jan 25, 2004 9:30 pm    Post subject: Reply with quote

Quote:
The syntax of grub for 2.6 is totally different from 2.4.


Actually the syntax for the new genkernel is different, It doesent have anything to do with the kernel. I have an old P1 box here that I do manually and the kernel line is still the same as 2.4
Back to top
View user's profile Send private message
allancairns
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 80
Location: Perth, Western Australia

PostPosted: Mon Jan 26, 2004 1:59 am    Post subject: Reply with quote

Suicidal wrote:
Quote:
The syntax of grub for 2.6 is totally different from 2.4.


Actually the syntax for the new genkernel is different, It doesent have anything to do with the kernel. I have an old P1 box here that I do manually and the kernel line is still the same as 2.4


I stand corrected :)
Back to top
View user's profile Send private message
wegewijs
n00b
n00b


Joined: 03 Feb 2004
Posts: 8

PostPosted: Wed Feb 04, 2004 9:00 pm    Post subject: Me too Reply with quote

Total n00b to Gentoo (not to linux)
Have the above problem also.
Kernel 2.6.1 gentoo-dev-sources
Stage1 install ofcourse 8)

Checked al of the above ofcourse. No deal.

I have on-board RAID controller but not configured to use RAID at all.
Highpoint 370A or so... do I need to compile it into kernel also (didn't try yet cus' I cant find it in menuconfig).

:oops: SOLVED From this forum I guessed I left something out in the kernel. Indeed including the HPT37X drivers into the kernel solved the problem. :roll:
Time to start fooling around with this sooo cooool distro
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Thu Feb 19, 2004 2:22 pm    Post subject: still no luck! Reply with quote

Hi all.

I've been suffering from this problem on one of my machines. The other two, one boots but the pci-pcmcia bridge is not supported yet, and the other works fine with 2.6.

Anyway, I've been through this topic and the searched forum in some detail. I don't pretend I've been exaustive, but l've read a lot. Here's my setup:

root and boot partitions:
Code:
/dev/hdb3 on / type reiserfs (rw,noatime,notail)
/dev/hdb2 on /boot type ext2 (rw,noatime)


drive controller
Code:
frankie # lspci | grep -i ide
00:07.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)


selected grub.conf bits
Code:
frankie # mount /boot
frankie # cat /boot/grub/grub.conf
default 1
fallback 0
timeout 10

title=Gentoo, Baby!
        root (hd0,1)
        kernel /kernel-2.4.22-gentoo-r5 root=/dev/hdb3

title=Gentoo 2.6
        root (hd0,1)
        kernel /kernel-2.6.1-gentoo root=/dev/hdb3

title=Love Gentoo
        root (hd0,1)
        kernel /boot/kernel-2.6.3_rc2-love2 root=/dev/hdb3


Hmm... grub partitions are back to front, probably because I installed
grub on hdb. 2.4 boots ok like that. Could it be a problem under 2.6? I find myself oddly reluctant to fiddle with it in case I break the whole system. Dunno why, I've fixed worse problems...

Anyway, I compiled a checklist:

root line in grub.conf: partition is /dev/hdb3 which is correct

devfs built in? mount at boot?
Code:
[*] /dev file system support (OBSOLETE)
[*]   Automatically mount at boot


PC Partition supported:
Code:
[*] Advanced partition selection
[*]   PC BIOS (MSDOS partition tables) support                     
[ ]   Windows Logical Disk Manager (Dynamic Disk) support       


reiserfs (root partition) supported
Code:
<*> Reiserfs support             
 [ ]   Enable reiserfs debug mode
 [ ]   Stats in /proc/fs/reiserfs


ext2 (boot partition) supported
Code:
<*> Second extended fs support
 [ ]   Ext2 extended attributes


drive controller built in?
Code:
<*>         Intel PIIXn chipsets support


Generic PCI bus-master DMA support
Code:
[*]       Generic PCI bus-master DMA support


Include IDE/ATA-2 DISK support
Code:
<*>     Include IDE/ATA-2 DISK support
[*]       Use multi-mode by default
[*]       Auto-Geometry Resizing support


boot partition mounted/kernel copied across/modules installed:
Code:
make menuconfig
make
make modules_install
mount /boot
cp arch/i386/boot/bzImage /boot/kernel-2.6.3_rc2-love2


Additionally:

I tried the experimental 2.6 LiveCD to see if I could adapt the config from /proc. Sadly, it hangs during the boot process. About the last message printed has it mis-identifying something (probably my adsl modem) as a USB storage device, which might have a bearing...

I tried genkernel ut was put off by the bugs in some of the earlier betas (I read the stuff about real_root /ram0 and linuxinit, but since it didn't help I went back to hand compiling. So - no initrd in grub.conf and hopefully none needed.

The machine causing the problem is an old P266 - a gateway G6-266 in fact. It's my firewall box and I would like to keep it reasonably up to date. Any ideas would be appreciated.

[ edited to reflect some other things tried ]
_________________
Don't let THEM immanentize the Eschaton!


Last edited by boroshan on Wed Apr 28, 2004 10:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
Epikuros
n00b
n00b


Joined: 19 Aug 2003
Posts: 56
Location: Helsinki, Finland

PostPosted: Thu Feb 19, 2004 3:35 pm    Post subject: Reply with quote

Well maybe I just post my version of the problem: IDE-hard-drive with hda1(ext3) as the bootable filesystem(/boot) and hda4(reiserfs) as the root(/).

I configured my 2.6-kernel(development sources) manually so no genkernel is involved . I did do
make menuconfig && make && make modules_install
mount /boot && copy arch/i386/boot/bzImage /boot/bzImage-2.6

2.4 boots up just fine but 2.6 ends in the kernel panic.

In kernel-config IDE-things are enabled as well as reiserfs and ext3.
The full configuration-files can be in the following addresses:
config-file for 2.4 kernel
config-file for 2.6 kernel

I have also tried hundred and one different combinations with no success yet

Here is the grub.conf:
#################
default 0
timeout 10

title=Gentoo Kernel
root (hd0,0)
kernel (hd0,0)/bzImage-2.4 root=/dev/hda4 video=vesafb vga=792 hdd=scsi

title=Development Kernel
root (hd0,0)
kernel (hd0,0)/bzImage-2.6 root=/dev/hda4
#################
_________________
---
Epikuros
Back to top
View user's profile Send private message
irf2003
Veteran
Veteran


Joined: 10 Sep 2003
Posts: 1078

PostPosted: Thu Feb 19, 2004 7:05 pm    Post subject: Reply with quote

"Automatically mount at boot" should be disabled if
you are using genkernel
the relevant parts of lilo.conf file should look something like this (please substitute with your kernel image)
Code:

image = /boot/kernel-2.6.3-gentoo
   root = /dev/sda3
   vga=0x31A
   label = 2.6.3-gentoo
   initrd=/boot/initrd-2.6.3-gentoo
   append="root=/dev/ram0 real_root=/dev/sda3 init=linuxrc video=:vesa:ywrap,mtrr  splash=verbose"

HTH
Back to top
View user's profile Send private message
Epikuros
n00b
n00b


Joined: 19 Aug 2003
Posts: 56
Location: Helsinki, Finland

PostPosted: Sat Feb 21, 2004 11:51 am    Post subject: Reply with quote

I've decided to post a little more info. Maybe that helps to solve the problem.

I installed the latest kernel-versions. The .config-files can still be found here:
config for 2.4.22-gentoo-r7
config for 2.6.3
both of these configs have the following:
Second extended fs support
Reiserfs-support
Ext3 journalling file system support
/dev file system support
Inculde IDE/ATA-2 DISK support
PCI IDE chipset support
Generic PCI bus-master DMA support
etc(if you want to see more detailed info check the config-files or if you are too lazy :wink: just ask me)

Still only the 2.4.22 boots while 2.6.3 ends up in kernel panic.

this time I used 'make install' so the new grub.conf looks like this(nothing changed but the names):
#########
default 0
timeout 10

title=Gentoo Kernel
root (hd0,0)
kernel (hd0,0)/vmlinuz-2.4.22-gentoo-r7 root=/dev/hda4 video=vesafb vga=792 hdd=scsi

title=Development Kernel
root (hd0,0)
kernel (hd0,0)/vmlinuz-2.6.3 root=/dev/hda4 video=vesafb vga=792
#########


the fstab looks like this(some comments stripped off):
#########
/dev/hda1 /boot ext3 noauto,noatime 1 2
/dev/hda2 none swap sw 0 1
/dev/hda3 /usr reiserfs notail 0 0
/dev/hda4 / reiserfs notail 0 0
/dev/cdroms/cdrom0 /mnt/cdrom1 iso9660 user,noauto,ro 0 0
/dev/cdroms/cdrom1 /mnt/cdrom iso9660 user,noauto,ro 0 0
/dev/fd0 /mnt/floppy ext2 user,noauto 0 0

# NOTE: The next line is critical for boot!
none /proc proc defaults 0 0

none /dev/shm tmpfs defaults 0 0
#########

Hard-drive is a normal ide-drive with capacity of 60GB(afaik Caviar Series from Western Digital), motherboard is asus P3B-F. Hardware however shouldn't be the issue here as 2.4-kernel(as have different versions of Windows) has always booted just fine.
_________________
---
Epikuros
Back to top
View user's profile Send private message
irf2003
Veteran
Veteran


Joined: 10 Sep 2003
Posts: 1078

PostPosted: Sat Feb 21, 2004 8:56 pm    Post subject: Reply with quote

Epikuros, I had a look at your 2.6.3 config files, and
here are my observations:-
loopback device & ram disk support should be enabled.
also set in initial ram disk of 8k
Code:

Device Drivers  --->
Block devices  --->
<*> Loopback device support
<*> RAM disk support
[8192] Initial RAM disk (initrd) support

you need to disable ATI Radeon display support,
you only need VESA VGA for the purposes of the
framebuffer.
Code:

Device Drivers  --->
Graphics support  --->
[*]   VESA VGA graphics support
<>   ATI Radeon display support

enble this to have a nice bootup screen.
Code:

Device Drivers  --->
Graphics support  --->
Bootsplash configuration  --->
[*] Bootup splash screen

Automatically mount at boot should be off,
/dev/pts was off it should be on.
Code:

File systems  --->
Pseudo filesystems  --->
[*] /dev file system support (OBSOLETE)
[]   Automatically mount at boot
[*] /dev/pts file system for Unix98 PTYs (note this should be selectected)
[*] Virtual memory file system support (former shm fs)

now assuming that you are using genkernel to compile your kernel
the "Development Kernel" part of your grub.conf file should look
something like this (you may need to change the image and initrd names):-
Code:

title=Development Kernel
root (hd0,0)
kernel (hd0,0)/boot/vmlinuz-2.6.3 root=/dev/ram0 init=/linuxrc real_root=/dev/hda4 vga=0x317
initrd (hd0,0)/boot/initrd-2.6.3

HTH
Back to top
View user's profile Send private message
alexlm78
Veteran
Veteran


Joined: 08 Dec 2003
Posts: 1265
Location: Guatemala,Guatemala

PostPosted: Sat Feb 21, 2004 9:04 pm    Post subject: Reply with quote

:arrow: Excelent !!!! :D
_________________
"This is a different kind of world, you need a different kind of software"

Linux User# 315201
www.alexlm78.org
www.dcforfans.org
100% Chapin hecho en Guatemala
Back to top
View user's profile Send private message
Epikuros
n00b
n00b


Joined: 19 Aug 2003
Posts: 56
Location: Helsinki, Finland

PostPosted: Sun Feb 22, 2004 9:12 am    Post subject: Reply with quote

irf2003 wrote:

now assuming that you are using genkernel to compile your kernel
the "Development Kernel" part of your grub.conf file should look
something like this (you may need to change the image and initrd names):-
Code:

title=Development Kernel
root (hd0,0)
kernel (hd0,0)/boot/vmlinuz-2.6.3 root=/dev/ram0 init=/linuxrc real_root=/dev/hda4 vga=0x317
initrd (hd0,0)/boot/initrd-2.6.3

HTH


I'm not using genkernel. Should I start using it? Has it any benefits? Your suggestions also seem to demand an installation of the initrd. I will configure it and see if it works...
_________________
---
Epikuros
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum