1 2 3 4 5 6 7 | pi@raspi1:~ $ sudo mount /mnt/nfsserver/backups mount .nfs: rpc.statd is not running but is required for remote locking. mount .nfs: Either use '-o nolock' to keep locks local , or start statd. mount .nfs: an incorrect mount option was specified pi@raspi1:~ $ sudo /etc/init .d /rpcbind start [ ok ] Starting rpcbind (via systemctl): rpcbind.service. pi@raspi1:~ $ sudo mount /mnt/nfsserver/backups |
Now you have manually fixed this once, but on the next reboot, your fix will be gone again. You need to fix that with the below steps, taken from this great help.
0. Assumptions
You have a working NFS mount on your Raspbian which is or can be mounted and configured e.g. into /etc/fstab
1. Make yourself root
1 | su - |
2. Create /etc/systemd/system/nfs-common.service
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | cat > /etc/systemd/system/nfs-common .service <<\EOF [Unit] Description=NFS Common daemons Wants=remote-fs-pre.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit= yes ExecStart= /etc/init .d /nfs-common start ExecStop= /etc/init .d /nfs-common stop [Install] WantedBy=sysinit.target EOF |
Copy paste the above and hit ENTER
3. Create /etc/systemd/system/rpcbind.service
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cat > /etc/systemd/system/rpcbind .service <<\EOF [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 EOF |
Copy paste the above and hit ENTER
4. Create /etc/tmpfiles.d/rpcbind.conf
1 2 3 4 5 6 | cat > /etc/tmpfiles .d /rpcbind .conf <<\EOF #Type Path Mode UID GID Age Argument d /run/rpcbind 0755 root root - - f /run/rpcbind/rpcbind .xdr 0600 root root - - f /run/rpcbind/portmap .xdr 0600 root root - - EOF |
Copy paste the above and hit ENTER
5. Configure the services to run at startup
1 2 | systemctl enable rpcbind.service systemctl enable nfs-common |
Copy paste the above and hit ENTER
6. Reboot and check if your NFS mount is there now
1 2 | pi@raspi1:~ $ mount nfsserver: /volume1/backups/raspi on /mnt/nfsserver/backups type nfs |
No comments:
Post a Comment