3

I'm trying to configure my RPi to use autofs to mount at boot a NFS share from my QNAP NAS.

The manual mount with

mount -v -t nfs server://share /mnt/share

works and also the autofs service works if I manually start it with

sudo service autofs start

after starting also rpcbind and nfs-common services first.

Now I want that all the 3 services involved (rpcbind, nfs-common and autofs) start automatically at boot.

Since Raspbian Jessie uses systemd, what should I do to add to the boot the rpcbind and nfs-common services, that should start before autofs?

Should I use init.d and so

sudo update-rc.d rpcbind enable

sudo update-rc.d nfs-common enable

or do I have to create a systemd unit file?

Cheshire Cat
  • 203
  • 3
  • 9

1 Answers1

1

I upgraded from Wheezy to Jessie and found that nfs wasn't mounting anymore.

I use mounting by editing fstab directly. This might not be an exact answer to your question, but it might fix your issue.

I've added the bold text to my existing mount entry.

192.168.123.123:/mnt/ext/some/dir /home/pi/for/example nfs4 _netdev,noauto,x-systemd.automount 0 0

This should make your disk mount at boot time.

Havnar
  • 1,617
  • 2
  • 16
  • 34
  • I used fstab too on Wheezy. But now I want to switch to autofs that is more robust and reliable. Anyway fstab works too on Jessie. Did you make a clean Jessie installation or did you make an upgrade? – Cheshire Cat Feb 11 '16 at 12:31
  • I did an upgrade, doing an upgrade with the old settings made the bootup wait 1min and 30sec for the nfs to be mounted, but it never succeeded, until after I changed the line. – Havnar Feb 11 '16 at 13:08
  • As reported here, upgrade from Wheezy to Jessie is discouraged. Anyway, there's an official upgrade procedure that is not guarantee to always work. – Cheshire Cat Feb 11 '16 at 20:52
  • I am aware of that, to me it was worth the risk of upgrading rather than reflashing the sd card. There is nothing imporant on this Pi other than lots of configs. So since I didn't want to do all the configs over, I decided the risk was worth it :) – Havnar Feb 13 '16 at 10:32