LinuxQuestions.org
Review your favorite Linux distribution.
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 11-17-2015, 06:30 AM   #1
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Rep: Reputation: Disabled
Booting kernel using NFS


Hello,

I had compiled kernel linux-4.2. and got the uImage.bin. I setup the tftp and nfs services on the server machine. Below are the env settings on the target board,

setenv bootargs console=ttyS0,115200 root=/dev/nfs rw ip=10.12.27.24:10.12.7.69:10.12.27.1:255.255.255.0:test1:eth0 nfsroot=10.12.7.69:/home/tftp/ker_4_2_6

the kernel boots and while loading the filesystem, i am getting the below error,
[ 14.508056] md: ... autorun DONE.
[ 109.532237] VFS: Unable to mount root fs via NFS, trying floppy.
[ 109.538612] (2,0): error -6
[ 109.545813] Please append a correct "root=" boot option; here are the available partitions:
[ 109.554131] 0100 65536 ram0 (driver?)
[ 109.558733] 0101 65536 ram1 (driver?)
[ 109.563330] 0102 65536 ram2 (driver?)
[ 109.567934] 0103 65536 ram3 (driver?)
[ 109.572532] 0104 65536 ram4 (driver?)
[ 109.577131] 0105 65536 ram5 (driver?)
[ 109.581729] 0106 65536 ram6 (driver?)
[ 109.586326] 0107 65536 ram7 (driver?)
[ 109.590925] 0108 65536 ram8 (driver?)
[ 109.595522] 0109 65536 ram9 (driver?)
[ 109.600123] 010a 65536 ram10 (driver?)
[ 109.604807] 010b 65536 ram11 (driver?)
[ 109.609490] 010c 65536 ram12 (driver?)
[ 109.614173] 010d 65536 ram13 (driver?)
[ 109.618866] 010e 65536 ram14 (driver?)
[ 109.623554] 010f 65536 ram15 (driver?)
[ 109.628253] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 109.636488] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

what more config's i need to add to the bootargs ??
 
Old 11-17-2015, 08:28 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Did you enable the nfs client for your kernel? It needs to be build in and not as a module.
 
Old 11-17-2015, 10:22 AM   #3
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Original Poster
Rep: Reputation: Disabled
yes, i had enabled the CONFIG_NFS_ROOT in .config. The nfs directory to be mounted is also fine, i can mount it independently. When you mentioned that "it needs to be build in" how exactly this has to be enabled ??
 
Old 11-17-2015, 10:29 AM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
In kernel config it must show up as <*>, not <M>.
 
Old 11-17-2015, 07:04 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Emerson View Post
In kernel config it must show up as <*>, not <M>.
To elaborate: <M> means the kernel will load the NFS subsystem as a module from a separate file. <*> means that NFS is included in the kernel; no loading required. Since the kernel can't access any files at this very early stage, NFS must be included.
 
Old 11-18-2015, 12:03 AM   #6
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Original Poster
Rep: Reputation: Disabled
i added the nfsrootdebug parameter in the bootargs, now the below errors are thrown. Is this some NFS server side issue ??

[ 14.557953] Root-NFS: nfsroot=/home/tftp/kernel_fs
[ 14.563221] NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,nolock,addr=10.12.7.69'
[ 14.571392] NFS: parsing nfs mount option 'vers=2'
[ 14.576345] NFS: parsing nfs mount option 'udp'
[ 14.581025] NFS: parsing nfs mount option 'rsize=4096'
[ 14.586315] NFS: parsing nfs mount option 'wsize=4096'
[ 14.591602] NFS: parsing nfs mount option 'nolock'
[ 14.596542] NFS: parsing nfs mount option 'addr=10.12.7.69'
[ 14.602272] NFS: MNTPATH: '/home/tftp/kernel_fs'
[ 14.606871] NFS: sending MNT request for 10.12.7.69:/home/tftp/kernel_fs
[ 14.614100] NFS: failed to create MNT RPC client, status=-128
[ 14.619834] NFS: unable to mount server 10.12.7.69, error -128

i have enabled all the NFS configurations in the menuconfig now. After doing some search around i found that errno 128 is "network unreachable".. looks bit weird, as i downloaded the kernel from the same nfs server. Apparently after booting the kernel somehow the network goes down or something

Last edited by gauravnaik; 11-18-2015 at 12:50 AM.
 
Old 11-18-2015, 01:24 AM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Your kernel has NIC driver built in?
 
Old 11-18-2015, 05:30 AM   #8
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Original Poster
Rep: Reputation: Disabled
I am not 100 sure whether NIC drivers are built in or not, but during boot i can see the below logs

[ 1.455057] brd: module loaded
[ 1.461856] loop: module loaded
[ 1.465753] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.5-k
[ 1.471561] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 1.477642] xhci_hcd 0000:00:04.1: xHCI Host Controller

Actually, i had enabled most of the drivers in .config, but the link is not up. Still debugging further into this...
 
Old 11-18-2015, 07:11 AM   #9
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Seems like nic gets loaded.

When you tested the ntfs root mount did you do it from the same subnet the booting machine is in? They are in different subnets maybe the gateway is not working...
Did you check the logs of ntfs around the time the client booted? Any connection attempts at all? Maybe user credentials?
 
Old 11-18-2015, 08:10 AM   #10
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Original Poster
Rep: Reputation: Disabled
is it mandatory to have initrd while booting the kernel and file systems from nfs ? as of now i have not given any initrd option while booting the kernel.
 
Old 11-18-2015, 08:58 AM   #11
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Make sure everything needed to boot is built in - not as module - and you won't need initrd.
 
Old 11-18-2015, 01:40 PM   #12
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by gauravnaik View Post
Apparently after booting the kernel somehow the network goes down or something
After booting, the NIC has to be reinitialized and new connections established.


On the NFS server, have you edited the /etc/hosts.allow file?
Sometimes a `sudo exportfs -a` command is also needed.

Last edited by blue_z; 11-18-2015 at 01:49 PM.
 
Old 11-18-2015, 01:57 PM   #13
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by gauravnaik View Post
setenv bootargs console=ttyS0,115200 root=/dev/nfs rw ip=10.12.27.24:10.12.7.69:10.12.27.1:255.255.255.0:test1:eth0 nfsroot=10.12.7.69:/home/tftp/ker_4_2_6
This looks peculiar.
Your target board is assigned the static IP address 10.12.27.24.
The NFS server has the IP address 10.12.7.69.
But you have assigned a netmask of 255.255.255.0, which means that the NFS server is not in the same subnet as your target.
That could explain the "network unreachable" message.
Simplify your network, and don't rely on a gateway.

Last edited by blue_z; 11-18-2015 at 02:17 PM.
 
Old 11-19-2015, 12:27 AM   #14
gauravnaik
LQ Newbie
 
Registered: Nov 2015
Location: India
Posts: 8

Original Poster
Rep: Reputation: Disabled
@ Emerson : while compiling the kernel i had compiled everything as built in. no external modules were present.

@blue_z : i tried your option also but still getting the same error

setenv serverip 10.0.0.10
setenv ipaddr 10.0.0.20
setenv netmask 255.255.255.0
setenv gatewayip 10.0.0.10
setenv bootargs "console=ttyS0,115200 root=/dev/nfs rw ip=10.0.0.20:10.0.0.10:10.0.0.10:255.255.255.0:host1:eth0ff nfsroot=10.0.0.10:/nfs/kernel_fs nfsrootdebug rootdelay=10"

when i boot the kernel i think my interface eth0 is not up or something. Is there any way to check this during boot. If eth0 itself is not UP & RUNNING than ip parameters will not be applied.
 
Old 11-19-2015, 01:55 AM   #15
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by gauravnaik View Post
setenv bootargs "console=ttyS0,115200 root=/dev/nfs rw ip=10.0.0.20:10.0.0.10:10.0.0.10:255.255.255.0:host1:eth0ff nfsroot=10.0.0.10:/nfs/kernel_fs nfsrootdebug rootdelay=10"
Instead of "...eth0ff", I used to use "on" for the autoconf even though there was a static IP address assignment.

Quote:
Originally Posted by gauravnaik View Post
Is there any way to check this during boot.
There should be driver messages for eth0 in the syslog.
I haven't used the "ip=..." kernel parameter in a while, but in 2.6 kernels there would be an "IP-Config" message in the syslog like:
Code:
Kernel command line: mem=32M console=ttyS0,115200 ip=192.168.2.129:::255.255.255.0:test29:eth0:on
...  
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
IP-Config: Complete:
     device=eth0, addr=192.168.2.129, mask=255.255.255.0, gw=255.255.255.255,
     host=test29, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
Freeing init memory: 384K

Last edited by blue_z; 11-19-2015 at 01:57 AM.
 
  


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
[SOLVED] Mount Nfs when booting hilou Linux - Newbie 2 11-16-2013 11:44 PM
uncompressing linux... ok booting the kernel hang message while OS booting ravindert Linux - Server 1 04-29-2013 12:58 PM
Kernel panic when booting via NFS ashwinikr Linux - Kernel 3 01-04-2007 03:43 PM
Questions about booting from NFS spuzzzzzzz Linux - Networking 1 07-04-2004 09:32 AM
booting new kernel. Booting new kernel dies with INIT: VFS issue, really mus335 Linux - General 0 04-21-2004 11:52 AM

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

All times are GMT -5. The time now is 01:12 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
Open Source Consulting | Domain Registration