Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Issues related to configuring your network
Post Reply
russell23
Posts: 134
Joined: 2006/10/27 06:27:39
Location: Inside a qubit

Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by russell23 » 2007/09/05 16:37:41

Dear CentOS users,

I am trying to set a diskless boot linux cluster with SUN Deskotp PCs. After lots of trial and error methods and from forum help I could now able to boot the client machine disklessly. But I have one problem is that, I am encountering the following error, I know this is due to kernel could not able to mount the root filesytem. Anybody have any advice, to correct this one?

#############################################################################

EXT2-fs: unable to read superblock
isofs_fill_super: bread failed, dev=md2, iso_blknum=16, block=32
No filesystem could mount root, tried: ext2 9660
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

#############################################################################

I am using TFTP and DHCP protocols.

Many thanks in advance.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Kernel Panic - not syncing: VFS: Unable to mount root fs on

Post by gerald_clark » 2007/09/05 18:20:02

What is your root supposed to be?
NFS, NBD?
Why is it trying to mount md2?
Did you modify the initrd to mount your nfs root before pivoting?

Do a google search for nfsroot.
There are many howtos out there.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by gerald_clark » 2007/09/05 19:27:36

You have to recompile the kernel to support root filesystem on nfs.
The Doc directory of the kernel sources has a nfsroot.txt with instructions.

blakegrover
Posts: 7
Joined: 2007/06/21 04:48:47
Location: Idaho

Re: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by blakegrover » 2007/09/06 15:50:13

I am having the same problems. Where can I find the nfsroot.txt file?

Thanks
Blake

blakegrover
Posts: 7
Joined: 2007/06/21 04:48:47
Location: Idaho

Re: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by blakegrover » 2007/09/06 15:58:21

I found an older nfsroot.txt file from another distribution and it said that you need to compile nfs file system support into the kernel. I am compiling the kernel now and I'll let you know if it helps

russell23
Posts: 134
Joined: 2006/10/27 06:27:39
Location: Inside a qubit

Re: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by russell23 » 2007/09/10 09:44:12

Dear Gerald,

Very kind of you for your reply and suggestion. I recompiled the kernel enabling NFS support downloading the source.rpm of kernel.
Now, I have an doubt, "Can't I just pass an message during boot to the kernel or initrd.img so that it can mount the root file system over the network via NFS to the client?"

If is it possible, I think I can just add an argument after the append flag in the pxelinux.cfg file to make it work. Am I right?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,2).

Post by gerald_clark » 2007/09/10 13:30:57

This is the nfsroot.txt document from the Documents directory of
the vanilla 2.6.9 kernel sources:

Mounting the root filesystem via NFS (nfsroot)
===============================================

Written 1996 by Gero Kuhlmann
Updated 1997 by Martin Mares

If you want to use a diskless system, as an X-terminal or printer
server for example, you have to put your root filesystem onto a
non-disk device. This can either be a ramdisk (see initrd.txt in
this directory for further information) or a filesystem mounted
via NFS. The following text describes on how to use NFS for the
root filesystem. For the rest of this text 'client' means the
diskless system, and 'server' means the NFS server.

1.) Enabling nfsroot capabilities
-----------------------------

In order to use nfsroot you have to select support for NFS during
kernel configuration. Note that NFS cannot be loaded as a module
in this case. The configuration script will then ask you whether
you want to use nfsroot, and if yes what kind of auto configuration
system you want to use. Selecting both BOOTP and RARP is safe.

2.) Kernel command line
-------------------

When the kernel has been loaded by a boot loader (either by loadlin,
LILO or a network boot program) it has to be told what root fs device
to use, and where to find the server and the name of the directory
on the server to mount as root. This can be established by a couple
of kernel command line parameters:

root=/dev/nfs

This is necessary to enable the pseudo-NFS-device. Note that it's not a
real device but just a synonym to tell the kernel to use NFS instead of
a real device.

nfsroot=[:][,]

If the `nfsroot' parameter is NOT given on the command line, the default
"/tftpboot/%s" will be used.

Specifies the IP address of the NFS server. If this field
is not given, the default address as determined by the
`ip' variable (see below) is used. One use of this
parameter is for example to allow using different servers
for RARP and NFS. Usually you can leave this blank.

Name of the directory on the server to mount as root. If
there is a "%s" token in the string, the token will be
replaced by the ASCII-representation of the client's IP
address.

Standard NFS options. All options are separated by commas.
If the options field is not given, the following defaults
will be used:
port = as given by server portmap daemon
rsize = 1024
wsize = 1024
timeo = 7
retrans = 3
acregmin = 3
acregmax = 60
acdirmin = 30
acdirmax = 60
flags = hard, nointr, noposix, cto, ac


ip=::::::

This parameter tells the kernel how to configure IP addresses of devices
and also how to set up the IP routing table. It was originally called `nfsaddrs',
but now the boot-time IP configuration works independently of NFS, so it
was renamed to `ip' and the old name remained as an alias for compatibility
reasons.

If this parameter is missing from the kernel command line, all fields are
assumed to be empty, and the defaults mentioned below apply. In general
this means that the kernel tries to configure everything using both
RARP and BOOTP (depending on what has been enabled during kernel confi-
guration, and if both what protocol answer got in first).

IP address of the client. If empty, the address will either
be determined by RARP or BOOTP. What protocol is used de-
pends on what has been enabled during kernel configuration
and on the parameter. If this parameter is not
empty, neither RARP nor BOOTP will be used.

IP address of the NFS server. If RARP is used to determine
the client address and this parameter is NOT empty only
replies from the specified server are accepted. To use
different RARP and NFS server, specify your RARP server
here (or leave it blank), and specify your NFS server in
the `nfsroot' parameter (see above). If this entry is blank
the address of the server is used which answered the RARP
or BOOTP request.

IP address of a gateway if the server is on a different
subnet. If this entry is empty no gateway is used and the
server is assumed to be on the local network, unless a
value has been received by BOOTP.

Netmask for local network interface. If this is empty,
the netmask is derived from the client IP address assuming
classful addressing, unless overridden in BOOTP reply.

Name of the client. If empty, the client IP address is
used in ASCII notation, or the value received by BOOTP.

Name of network device to use. If this is empty, all
devices are used for RARP and BOOTP requests, and the
first one we receive a reply on is configured. If you have
only one device, you can safely leave this blank.

Method to use for autoconfiguration. If this is either
'rarp' or 'bootp', the specified protocol is used.
If the value is 'both' or empty, both protocols are used
so far as they have been enabled during kernel configura-
tion. 'off' means no autoconfiguration.

The parameter can appear alone as the value to the `ip'
parameter (without all the ':' characters before) in which case auto-
configuration is used.

3.) Kernel loader
-------------
To get the kernel into memory different approaches can be used. They
depend on what facilities are available:

3.1) Writing the kernel onto a floppy using dd:
As always you can just write the kernel onto a floppy using dd,
but then it's not possible to use kernel command lines at all.
To substitute the 'root=' parameter, create a dummy device on any
linux system with major number 0 and minor number 255 using mknod:

mknod /dev/boot255 c 0 255

Then copy the kernel zImage file onto a floppy using dd:

dd if=/usr/src/linux/arch/i386/boot/zImage of=/dev/fd0

And finally use rdev to set the root device:

rdev /dev/fd0 /dev/boot255

You can then remove the dummy device /dev/boot255 again. There
is no real device available for it.
The other two kernel command line parameters cannot be substi-
tuted with rdev. Therefore, using this method the kernel will
by default use RARP and/or BOOTP, and if it gets an answer via
RARP will mount the directory /tftpboot// as its
root. If it got a BOOTP answer the directory name in that answer
is used.

3.2) Using LILO
When using LILO you can specify all necessary command line
parameters with the 'append=' command in the LILO configuration
file. However, to use the 'root=' command you also need to
set up a dummy device as described in 3.1 above. For how to use
LILO and its 'append=' command please refer to the LILO
documentation.

3.3) Using loadlin
When you want to boot Linux from a DOS command prompt without
having a local hard disk to mount as root, you can use loadlin.
I was told that it works, but haven't used it myself yet. In
general you should be able to create a kernel command line simi-
lar to how LILO is doing it. Please refer to the loadlin docu-
mentation for further information.

3.4) Using a boot ROM
This is probably the most elegant way of booting a diskless
client. With a boot ROM the kernel gets loaded using the TFTP
protocol. As far as I know, no commercial boot ROMs yet
support booting Linux over the network, but there are two
free implementations of a boot ROM available on sunsite.unc.edu
and its mirrors. They are called 'netboot-nfs' and 'etherboot'.
Both contain everything you need to boot a diskless Linux client.

4.) Credits
-------

The nfsroot code in the kernel and the RARP support have been written
by Gero Kuhlmann .

The rest of the IP layer autoconfiguration code has been written
by Martin Mares .

In order to write the initial version of nfsroot I would like to thank
Jens-Uwe Mager for his help.

Post Reply