# fstab entries with remote mounts



## balanga (Nov 18, 2018)

I have numerous remote mounting points in my /etc/fstab and these work fine when I'm at home, however when I'm away they obviously do not work so get errors while booting. Is there any way to amend these entries so that mounts are not attempted when I'm away or should I use an /etc/fstab.home and /etc/fstab.away?


----------



## DavidMarec (Nov 18, 2018)

I do not understood clearly how you can tell the system that you are _away_ or not; btw:

Defines the suitable _mountpoints_ as noauto in fstab, so that they will not be mounted automatically at boot time.
Then, write a rc(8) script that will mount these manually. Call this script when you are _at home_, may be using sysrc(8) to toggle this option.


----------



## Phishfry (Nov 18, 2018)

failok
https://forums.freebsd.org/threads/can-i-make-fstab-more-robust.68106/


----------



## ShelLuser (Nov 18, 2018)

balanga said:


> I have numerous remote mounting points in my /etc/fstab and these work fine when I'm at home, however when I'm away they obviously do not work so get errors while booting.


Sounds like you want "on-demand" mounted filesystems, which can be achieved by using autofs(5). That's what I'd try: remote's won't be mounted unless you actually change to the right (virtual) mountpoint / directory.


----------



## obsigna (Nov 18, 2018)

You did not inform the file system type. In the case of NFS mounts by the way of /etc/fstab, besides failok like Phishfry suggested, we need to specify retrycnt=1, otherwise /etc/rc.d/mountcritremote would try forever, each try having a timeout of 60 s.


----------

