0

I'm trying to set up a couple of NFS mounts to automatically mount at boot. I'm not new to this; I did this on Solaris in 1985.

Here's what I have in /etc/fstab:

iomega:/nfs/Music   /music  nfs rw,auto,user    0   0

It doesn't mount at boot and leaves this message in syslog:

Mount process exited, code=exited status=32

It didn't work in 18.04, and I just upgraded today to 18.10 and it still doesn't work. If I do a mount -a after boot, that fs mounts normally. I've tried several suggestions about adding systemd-specific parameters to the mount options, but none of them worked.

This is basic functionality. It should JFW. Can anybody tell me what the exit code 32 means and how to make this work?

2 Answers2

0

Try changing the options in your /etc/fstab on that line to read like the following:

iomega:/nfs/Music /music  nfs defaults,nofail   0   0

I use NFS at home as well, and these options have never failed me.

I am not sure what the code 32 means, but this one backs up my answer:

https://ubuntuforums.org/showthread.php?t=2389242

Hope this helps!

Terrance
  • 41,612
  • 7
  • 124
  • 183
  • Tried it, didn't work. Digging a little deeper into syslog, it looks like the network isn't available when it tries to do the mount. This is on my laptop using wifi. I suspect (but haven't tried yet) that it would work if I was on a wired connection but it's not smart enough to wait for the wifi to start up. Looks like a post-boot workaround is in order. – Mike Jones Oct 25 '18 at 14:49
  • @MikeJones I guess you could try changing the iomega to the actual IP address of it. Or add a line to your /etc/hosts for the IP then name of iomega. There could be a chance that DNS isn't quite caught up during boot yet. The nofail option that is added is because if the device is not available during boot the system will continue to boot regardless. – Terrance Oct 25 '18 at 15:21
0

Try autofs. You can give it a try like what I did.

  1. Install NFS Client
apt -y install nfs-common
  1. Configure auto-mounting
apt -y install autofs
  1. Edit auto.master file
vi /etc/auto.master

Add /- /etc/auto.nfs at the bottom.
(You can give a different name rather than auto.nfs.)

  1. Write auto.nfs
vi /etc/auto.nfs

Write as /nfs/share -fstype=nfs4,rw server:remote-point.

In case your server uses nfs4.0 you would better to add an option like this.
/nfs/share -fstype=nfs4,rw -vers=4.0 server:remote-point

  1. Create a directory and run
mkdir /nfs/share
systemctl restart autofs
  1. Check if it works
ls /nfs/share

ref: Configure NFS Client