Raspbian: fstab doesn’t mount NFS on boot
Ran out of disc space in one of my Raspberry Pi projects last night. Of course I did a quick and dirty install with NOOBs so cloning to a larger SD-card felt like a drag. So I decided it was time to upgrade from a 4GB SD to a 16GB SD as well as the latest version 4.1.6+. Installation went like a charm until I went to edit my /ect/fstab. I added the same NFS line as I used before:
[ps]192.168.0.5:/nfs/Download /mnt/download nfs rsize=8192,wsize=8192,timeo=14,intr 0 0[/ps]
sudo mount -a work just fine but the share wasn’t mounted after reboot. Googled the issue and found a lot of different suggestions, many related to USB drives. The number one suggestion was adding rootdelay=10 or rootdelay=5 to /boot/cmdline.txt. That would probably solve the issue for USB drives because the system are unable to identify the drive that early in the boot. Same suggestion was given for NFS failures as well but will not work. Tried a lot of suggestions, even found scripts to run mount -a after boot. That is not a solution just a work around!
Suggestion for adding x-systemd.automount,noauto to the mount options failed as well. Tried a lot of different configurations with one thing in common, no error in /var/log/syslog.
Finally I realized that the network was not ready! I checked the /etc/network/interfaces settings for eth0.
[ps]iface eth0 inet manual[/ps]
It will still get a DHCP address but that will happen later in the boot process. So when the fstab entries are processed there is no network connection and therefore the disc will not mount. So if you change it to:
[ps]iface eth0 inet dhcp[/ps]
Then the NFS drive will mount just fine after a reboot.