To automatically connect to a NFS share when booting:
-
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:- 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. - Where to mount it
- How to mount it - in this case, by using
nfs
.
- What to mount - in my case,
-
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
-
Run
sudo systemctl enable rpcbind.service
-
Reboot the Raspberry Pi.