7

I have a raspberry pi model b+ that I am attempting to boot with a root on an nfs share. The pi takes an ip address from dhcp, and makes request to my nfs server for the root share. The server reports this request in logs, but the pi hangs after printing its ip configuration. The last cmdline.txt I tried contained: root=/dev/nfs rw nfsroot=192.168.2.25:/srv/rpi-root-nfs,tcp ip=dhcp vers=3

/etc/exports on the nfs server contains: /srv/rpi-root-nfs 192.168.2.0/24(rw,sync,no_root_squash,no_all_squash,insecure)

Are there any problems with this configuration?

UPDATE (06-06-2016) -- took a picture of the boot logs with loglevel set to 7. The line [ 7.318013 ] ... rootpath= is odd, as rootpath should be set, according to the kernel line.

7.318013 rootpath is not set

gnarly-line
  • 71
  • 1
  • 5

4 Answers4

2

I had the same problem. For me the fix was to force NFS version 3, by appending v3 as option to nfsroot:

nfsroot=192.168.2.25:/srv/rpi-root-nfs,tcp,v3
hfs
  • 121
  • 3
0

For anyone who finds this thread in the future and desperate to understand why the linux kernel is hanging with no useful information:

NFS V2 is no longer supported on Ubuntu Server by default. Which means if your ARM kernel supports v2, v3 and v4 it won't boot because it doesn't check v3 or v4 when v2 doesn't work.

The solution is to disable nfs v2 in your ARM kernel, then it will mount from the modern AMD64 server via nfs v3.

A total stab in the dark worked out for me. I hope this helps someone else.

BrianT
  • 1
0

I had (yet) again this issue. A way to solve it that's not mentioned in this thread is to get the 'rootpath' value (printed by the Kernel above as empty) to use the value provided by the DHCP server.

For dev setup this meant for me the 'root-path' option in the server config, which for 'isc-dhcp-server' was to add (for example) this in /etc/dhcp/dhcpd.conf:

option root-path "SERVERIP:/PATH/TO/NFSMOUNT,wsize=1024,rsize=1024,v3"

This is not a solution but a workaround. The one in previous comment (forcing NFS v3 in the kernel command line) didn't seem to work for me.

0

First off thanks for asking this question. I did not realize this could be done so it was fun trying to get it to work.

I got it to work and here is how I did it.

  1. I created a folder to export on my NAS, mounted the Raspian Stretch Lite image and it's two partitions. I then copied the system ext4 partition contents to the NAS folder and the Boot partition contents to a fat32 partition on the boot medium (in this case a USB flash drive).

  2. I edited the /etc/fstab file commenting out the root mount line so it would not try to remount /.

  3. Since I had labeled the boot fat32 partition as BOOT, I changed the /boot line to: LABEL=BOOT /boot vfat defaults 0 2

  4. To the exports file on my NAS I added: /mnt/RPi 192.168.0.199(rw,sync,no_root_squash,insecure)

  5. I edited the cmdline.txt file in the boot partition and ended up with this line: wc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/nfs rw nfsroot=192.168.0.99:/mnt/RPi,tcp ip=dhcp vers=3 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait splash

It booted without an error. Hope that helps.