Yaakov Online


I fight with computers

Yaakov
Author

Share


Tags


NFS on Raspbian (Jessie) at boot

To automatically connect to a NFS share when booting:

  1. Add a line for your NFS share to /etc/fstab. For me, I'm connecting to my NAS named Scarif, on a share named PiData, and mounting it to /mnt/pidata.

     scarif.local:/volume1/PiData /mnt/pidata nfs
    

    The fstab line is in three parts:

    1. What to mount - in my case, scarif.local is the mDNS name of the NAS, and /volume1/PiData is the local path on the NAS.
    2. Where to mount it
    3. How to mount it - in this case, by using nfs.
  2. Create /etc/systemd/system/rpcbind.service with the following contents:

     [Unit]
     Description=RPC bind portmap service
     After=systemd-tmpfiles-setup.service
     Wants=remote-fs-pre.target
     Before=remote-fs-pre.target
     DefaultDependencies=no
     
     [Service]
     ExecStart=/sbin/rpcbind -f -w
     KillMode=process
     Restart=on-failure
     
     [Install]
     WantedBy=sysinit.target
     Alias=portmap
    
  3. Run sudo systemctl enable rpcbind.service

  4. Reboot the Raspberry Pi.

Author

Yaakov