fstab settings for "not always there" share

Soldato
Joined
14 Mar 2011
Posts
5,439
Hey all,

I'm relatively experienced as a linux user but not had to do a lot of admin stuff before, and I'm trying to work out what I would need to put in my /etc/fstab in order to make it so an NFS share I have on my Microserver will always be mounted to a particular location...

However, I want it to be in such a way that if for any reason I switch on my laptop and the NFS share is unreachable (network trouble, server not on, etc etc) it won't cause the system to hang on startup and it'll just not be accessible at the mount point... but then any time I try to access it there it would try to connect again

I think this is called a "sloppy" mount (hew hew hew) but what exactly do I have to put in fstab for that?
 
It sounds like (not sitting in front of a linux box at the moment) you should be configuring automount/autofs instead of putting an entry in fstab. Probably with the soft option so it wont cause a hang if the server is not there.

Then when the mount point directory is attempted to be accessed it should try and mount the share if it is not already mounted.
 
That sounds right to me - I'll have a read on automount/autofs and give it a shot later

Update (for the benefit of anyone finding this thread through search etc):

Automount was absolutely the right call, thanks again :)

I just installed automount, then had to add a file at /etc/auto.nfs and point my /etc/auto.master file at it, providing a suitable root for the mount... then inside the file I created entries for each of the shares I wanted to be mountable, i.e.

share1 host:/path/to/share1
share2 host:/path/to/share2

Restarted the service and all works as it should
 
Last edited:
This is my fstab entry on Ubuntu server:

Code:
192.168.1.4:/volume1/video /video nfs nouser,rsize=8192,wsize=8192,atime,aut
o,rw,dev,exec,suid 0 0

I had to apt-get install nfs-common for it to work.

Can't VPN home from this works machine but I think I made it much simpler.

If the share is off then /video just doesn't have anything there, there's no delay in booting.
 
Back
Top Bottom