# NFS root [SOLVED]

## xaviermiller

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:

```
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
```

```

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:

```

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

EDIT: SOLVED with NFSV3  :Smile: 

----------

## krinn

This is not a valid nfsv4 configuration  :Smile: 

```

/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  :Smile: 

```
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

----------

## xaviermiller

I see... will fix that and go back  :Smile: 

Thank you very much, krinn, for the long explanation !

----------

## xaviermiller

SOLVED by using NFSV3  :Smile: 

----------

