Failing nfs mount in fstab - how to handle

I have an nfs mount in my fstab which fails sometimes because the nfs server ip address changes.

What options do I need to set in the nfs entry to prevent the boot process complaining that there is no connection to the server?

Not really sure whether to use failok, late or something else...
 
Hi Mate, you can use the noauto option in your fstab
that will set the nfs share not to automount

so you would need to manually mount the nfs share after you login

Code:
rw,noauto
 
If I understand correctly, you mount the share and sometime after the IP address of the server changes -- you know, servers of any kind should not have DHCP assigned IP addresses unless the DHCP server assigns a fixed address; I assign a fixed address to my FreeBSD laptop at home while everything else gets floating addresses. But I digress.

If the above is true you can try am-utils. Autofs will probably lookup the IP address just like a regular mount will. But autofs has a bug in -hosts maps handling so you're left with amd from the am-utils port. In that case you would configure a host map /net, just like we did Solaris autofs. Then cd /net/hostname.domainname/dir1/dir2/dir3. And there you are. If the share is unused for five minutes it will be automatically unmounted, and remounted later when you use it again.

This is a bit of a hack but the only way I can see you could circumvent the problem. Ideally your NFS server should have a static IP address.

One other question. Could you possibly be using NFS over the broader Internet? If yes, this is a *very* bad idea. NFS is generally not secure and even with encryption we don't know where the vulnerabilites are. Steer clear of NFS over the Internet. The chances of getting hacked are unknown at best and a probability for sure.
 
No. `mount -a` will not mount noauto entries.
That's how it looked.

So what I'm looking for is means to stop searching for a connection during boot after which I can automatically locate the correct host and mount the share using mount -a.

I see a timeout option in
mount_nfs()
but can't get it to work. I've also tried failok, and late, but can't get them to work.

My
rc.local
corrects the

/etc/fstab

entry to runs too late in the boot process. I need to find a way to run some code before the boot process tries to assign the nfs share.

Maybe I need to look at autofs.... but the seems far more complicated.
 
Back
Top