Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NFS root [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7905
Location: ~Brussels - Belgique

PostPosted: Wed Jan 28, 2015 8:28 am    Post subject: NFS root [SOLVED] Reply with quote

H !

I am trying to have a NFS root on my raspberry pi, but the NFS root doesn't come up. I see that it gets an IP address in the serial console.

I can mount the NFS share from other computers, but I don't know what configuration is missing.
It's a NFSv4 server.

Here are the configurations:
cmdline.txt:
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200  smsc95xx.turbo_mode=N  root=/dev/nfs nfsroot=192.168.178.43:/data/raspi_root,udp,vers=4,_netdev rootfstype=nfs ip=dhcp

kernel:

Networking options:
<*> Packet socket
<*> Unix domain sockets
<*> Transformation user configuration interface
[*] TCP/IP networking
[*]   IP: multicasting
[*]   IP: advanced router
[*]     IP: policy routing
[*]     IP: equal cost multipath
[*]     IP: verbose route monitoring
[*]   IP: kernel level autoconfiguration
[*]     IP: DHCP support
[*]     IP: BOOTP support
[*]     IP: RARP support

NFS options:
--- Network File Systems
<*>   NFS client support
< >     NFS client support for NFS version 2
<M>     NFS client support for NFS version 3
[*]       NFS client support for the NFSv3 ACL protocol extension
<*>     NFS client support for NFS version 4
[*]     Provide swap over NFS support
[*]   NFS client support for NFSv4.1
[*]     NFS client support for NFSv4.2
(kernel.org) NFSv4.1 Implementation ID Domain
[ ]     NFSv4.1 client support for migration
[*]   Root file system on NFS
[ ]   Use the legacy NFS DNS resolver
< >   NFS server support


On the server:
/etc/exports:

/data/raspi_root *(rw,no_root_squash,no_subtree_check)



EDIT: SOLVED with NFSV3 :)
_________________
Kind regards,
Xavier Miller


Last edited by xaviermiller on Mon Feb 02, 2015 7:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6970

PostPosted: Wed Jan 28, 2015 2:22 pm    Post subject: Reply with quote

This is not a valid nfsv4 configuration :)
Code:

/etc/exports:   

/data/raspi_root *(rw,no_root_squash,no_subtree_check)


nfsv4 server need a tree with a rootfs that is define by fsid=0
however depending on nfsv4 version it is more or less valid ; as some will consider your /data/raspi_root to be fsid=0 as you lack any
you really should fix it to conform to the standard way of configuring a nfsv4 server, to avoid random result depending on the server version and tools that handle it trying to handle something that is not "right".

And this is not a valid nfsv4 mount :)
Code:
nfsroot=192.168.178.43:/data/raspi_root


nsfv4 takes its rootfs as the root of the tree, and any mount should depend on that root leaf node.
ie:
/mypathislong/long/verylong/data fsid=0 (your rootfs)
/mypathislong/long/verylong/data/rapsi_root
/mypathislong/long/verylong/data/anothermount
/mypathislong/long/verylong/data/omglong/really

If you want mount them, nfsv4 server will answer to:
mount server:/omgmypathislong/long/verylong/data/rapsi_root
-> only if your mount is nfsv3, so an nfsv4 client could still mount nfsv3 shares.
or
mount server:/rapsi_root
-> nfsv4 client asking nfsv4 server to mount nfsv4 shares (see /omgmypathislong/long/verylong/data is fsid=0 so your rootfs, so mount depend on that first node, so / (first node) + rapsi_root (next node, as rapsi_root is a subdir of your rootfs)
And again, because this time of nfs-utils version, some may agree to mount it even if you pass nfsv3 style mount when trying to mount nfsv4 shares. So again, random result, better pass it like it should.
to mount the "really" mount point from my example with nfsv4: mount server:/omglong/really

You better review your nfsv4 config for your server, and client should be change to ask it in nfsv4 style ; without being high guesser, certainly you will end with : nfsroot=192.168.178.43:/raspi_root
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7905
Location: ~Brussels - Belgique

PostPosted: Wed Jan 28, 2015 2:37 pm    Post subject: Reply with quote

I see... will fix that and go back :)
Thank you very much, krinn, for the long explanation !
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7905
Location: ~Brussels - Belgique

PostPosted: Mon Feb 02, 2015 7:38 pm    Post subject: Reply with quote

SOLVED by using NFSV3 :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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