LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-03-2008, 07:11 PM   #1
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Rep: Reputation: 15
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)


There are some similar threads on this already, but I haven't found a resolution

I have a system installed from the Gentoo 2008.0 live CD. It works fine. However, I downloaded (emerge) the newest source and compiled a new kernel and I am unable to boot using it. I can still boot using old kernel.

If I try to boot via new kernel I get this error:
Code:
VFS: Cannot open root device "sda3" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
0200		 4 fd0	(driver?)
0100	      4096 ram0 (driver?)
****snip****
010f	     4096 ram15 (driver?)
0300	39082680 hda driver: ide-disk
  0301	104391 hda1
  0302	987997 hda2
  0303  37985692
Kernel panic - not syncing: VFS:  Unable to mount root fs on unknown-block(2,0)

I have a single ATA drive in this system, but fstab generated by liveCD install looks like this:
Code:
/dev/sda1	 /boot	 ext2	 defaults		 1 2
/dev/sda2	 none            swap            sw              0 0
/dev/sda3	 /	 ext3	 noatime		 0 1
none        	/proc     proc    defaults          0 0
none        	/dev/shm  tmpfs   defaults          0 0
/dev/cdrom	/cdrom	auto	ro,noauto,user,exec	0 0

Grub.conf looks like this:
Code:
default 0
timeout 30
#splashimage=(hd0,0)/grub/splash.xpm.gz

title=linux 2.6.25-gentoo-r9 compiled
root (hd0,0)
kernel /kernel-2.6.25-gentoo-r9 root=/dev/sda3

title=genkernel-x86-2.6.24-gentoo-r5
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 
initrd /initramfs-genkernel-x86-2.6.24-gentoo-r5
Since the error says that only hdax drives are available, as trouble shooting steps, I've tried editing the lines via grub at boot time to read: "kernel /kernel-2.6.25-gentoo-r9 root=/dev/hda3". and also "kernel /kernel-2.6.25-gentoo-r9 ro root=/dev/hda3" With either of those changes, the system starts to boot, but then I get a different error:

Code:
fsck.ext3: No such file of directory while trying to open /dev/sda3
/dev/sda3:
The superblock could not be read or does not describe a correct ext2 filesystem.  If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
         e2fsck -b 8193 <device>
It seems like a driver issue to me, but I haven't been able to figure it out. Please help. TIA.

-Mats

Last edited by matsvw; 12-04-2008 at 03:54 PM.
 
Old 12-03-2008, 07:59 PM   #2
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Will try and help.

The first thing i would recommend checking is that you have ext3 support enabled in the new kernel.
 
Old 12-04-2008, 03:39 AM   #3
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Rep: Reputation: 15
You have forgotten to include path of initial ramdisk (initrd )image for newly compiled kernel in grub.conf
 
Old 12-04-2008, 01:40 PM   #4
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for the replies.

I just double checked my .config file and EXT2 and EXT3 are included (see code below).

Next I'll try adding an initrd image.



Code:
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=y
CONFIG_FS_MBCACHE=y
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y
# CONFIG_FUSE_FS is not set
CONFIG_GENERIC_ACL=y

Last edited by matsvw; 12-04-2008 at 03:55 PM.
 
Old 12-04-2008, 02:59 PM   #5
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Creating initrd didn't help, but at least I get a new error. :-)

Code:
mount: error 6 mounting ext3
pivotroot: pivot_root(/sysroot,/sysroot/initrd) failed: 2
umount /initrd/proc failed: 2
Freeing unused kernel memory: 236k freed
Kernel panic - not syncing: NO init found.  Try passing init- option to kernel
for full error see screen shot:badboot.JPG

I created initrd file and changed grub.conf to read:

Code:
default 0
timeout 30
#splashimage=(hd0,0)/grub/splash.xpm.gz

title=linux 2.6.25-gentoo-r9 compiled
root (hd0,0)
kernel /kernel-2.6.25-gentoo-r9 root=/dev/sda3
initrd /initrd-2.6.25-r9


title=genkernel-x86-2.6.24-gentoo-r5
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 
initrd /initramfs-genkernel-x86-2.6.24-gentoo-r5
I've been banging my head against this for days, it really can't be this hard....

thanks again for the help.
 
Old 12-04-2008, 04:11 PM   #6
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Just an update on my (lack of progress). I added 'init=3' to the kernel line in grub.conf, but no dice. I also researched more about initrd and it seems like I shouldn't need it if I have the correct drivers compiled into the kernel. So I think I may be back to square one.

-Mats
 
Old 12-04-2008, 04:11 PM   #7
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Just an update on my (lack of progress). I added 'init=3' to the kernel line in grub.conf, but no dice. I also researched more about initrd and it seems like I shouldn't need it if I have the correct drivers compiled into the kernel. So I think I may be back to square one.

-Mats
 
Old 12-09-2008, 06:38 PM   #8
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Cool Solved!

The new kernel wanted to mount /dev/hda3 as root rather than /dev/sda3. fstab as created by original install looked like this:
Code:
/dev/sda1	 /boot	 ext2	 defaults		 1 2
/dev/sda2	 none            swap            sw              0 0
/dev/sda3	 /	 ext3	 noatime		 0 1
Altering grub.conf to point to /dev/hda3 didn't work because the entry in fstab still refered to sda3. In addition to altering grub.conf, I had to edit fstab to use hdax instead of sdax. My new fstab looks like this:
Code:
/dev/hda1	 /boot	 ext2	 defaults		 1 2
/dev/hda2	 none            swap            sw              0 0
/dev/hda3	 /	 ext3	 noatime		 0 1
none        /proc     proc    defaults          0 0
none        /dev/shm  tmpfs   defaults          0 0
/dev/cdrom	/cdrom	auto	ro,noauto,user,exec	0 0
and grub.conf now looks like this:
Code:
default 0
timeout 30

title=linux 2.6.25-gentoo-r9 custom
root (hd0,0)
kernel /kernel-2.6.25-gentoo-r9 root=/dev/hda3

title=genkernel-x86-2.6.24-gentoo-r5
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 
initrd /initramfs-genkernel-x86-2.6.24-gentoo-r5

Also, thanks for the responses. While they didn't solve the issue directly, your responses led me down paths I hadn't thought of so I was eventually able to figure it out. Now that I understand the problem, it seems painfully obvious. Ironically, the original genkernel now fails to boot due to the change in fstab. :-)
 
Old 12-17-2008, 12:31 AM   #9
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
That's weird that your new kernel would want to mount to /dev/hda3 instead of /dev/sda3. hda is for IDE devices while sda is for SCSC/SATA devices. Have you done a file <kernel file> on both your old and new kernels and see what's the root_dev of them? I suspect they may be different. To the best of my knowledge, if your drive is a SATA drive, it should be sdX instead of hdX(unless you have AHCI disabled and IDE emulation enabled in your system BIOS).
 
Old 12-17-2008, 12:00 PM   #10
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
I thought it was odd too and that was part of the reason why it took me so long to edit the fstab file. The drive is an ATA drive, but the controller can handle SATA drives as well and that was initially enabled on the motherboard. I toggled the setting off and on during trouble shooting, but it made no difference with the new kernel or original kernel. I'm still pretty new at this so it's totally possible that I've missed something.
 
Old 01-13-2009, 06:56 PM   #11
Harp00
Member
 
Registered: Jun 2003
Location: Venice Italy
Distribution: Slackware 12.0 kernel 2.6.21.5
Posts: 284

Rep: Reputation: 30
title=linux 2.6.25-gentoo-r9 custom
root (hd0,0)
kernel /kernel-2.6.25-gentoo-r9 root=/dev/hda3


I think you should change root (hd0,0) into (hd0,2)
 
Old 01-14-2009, 11:24 AM   #12
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Harp00 View Post
title=linux 2.6.25-gentoo-r9 custom
root (hd0,0)
kernel /kernel-2.6.25-gentoo-r9 root=/dev/hda3


I think you should change root (hd0,0) into (hd0,2)
Thanks for the reply. I tried that when I was trouble shooting, it didn't help. There's probably a more elegant fix than the one I did, but it was definitely related to the way the drives were being detected (SATA vs. ATA).

-Mats
 
Old 02-28-2009, 10:53 AM   #13
ron.w
LQ Newbie
 
Registered: Feb 2009
Location: Greenville, SC
Distribution: Ubuntu 8.10
Posts: 2

Rep: Reputation: Disabled
Additional info re: Kernel panic - not syncing: VFS: Unable to mount root fs ...

I had roughly the same issue. Just installed Unbuntu 8.10 (my first Linux install) using WUBI on dual boot system with XP and 30GB SATA harddrive.

After initial install, I had a ton of updates (295, I think) to install. During install, I had some processes hang. On reboot, I got the kernel panic with unknown-block(0,0) for kernel 2.6.27-11-generic. After googling the issue, I finally used the previous kernel 2.6.27-7-generic to boot.

Older kernel booted fine, and I went into Synaptic to continue updates. Synaptic told me to run "dpkg --configure -a" to clear up issues it had. I did so, and dpkg found and cleaned up the 2.6.27-11-generic kernel issue. Sorry, it was a couple days ago, so I don't remember the exact messages.

Rebooted normally, and things have been fine since.

I'm a Linux newby, so please ask if I've not provided all the information you need. I'm not posting for help, but to provide additional information for debugging and to let folks know what worked for me.
 
Old 06-21-2011, 06:55 AM   #14
Robin Thankachan
LQ Newbie
 
Registered: Jun 2011
Location: Kollam, Kerala/ Hyderabad, AP, India
Posts: 3

Rep: Reputation: Disabled
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

i got the same error while booting set top box... pls gve me a solution for this


Root-NFS: Server returned error -5 while mounting /home/...../target
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
 
Old 06-21-2011, 11:56 AM   #15
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Robin Thankachan View Post
i got the same error while booting set top box... pls gve me a solution for this


Root-NFS: Server returned error -5 while mounting /home/...../target
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
The solution to my issue is in post #8 Post your grub and fstab files, that may help. Also is this a new install?
 
  


Reply



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
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1) anjanesh Ubuntu 9 01-27-2011 12:00 PM
Kernel panic - not syncing:VFS: Unable to mount root fs on unknown-block (1,0) Zenx Linux - Kernel 12 08-04-2010 05:33 AM
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,4) mr.gizm0 Linux - Newbie 5 09-01-2007 03:58 PM
kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(3,2) o2bfishn Slackware 5 04-28-2006 03:51 PM
Kernel Panic!!! -Not Syncing VFS:Unable to mount root FS on unknown - block (0,0) scarabs Linux - Software 4 04-16-2006 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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

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
Open Source Consulting | Domain Registration