Ask Your Question
1

nfs mount in fstab should not wait if server is not available

asked 2016-12-05 09:47:20 -0500

gobigobi66 gravatar image

updated 2016-12-05 09:48:25 -0500

Hi,

I have set up a backup of my laptop to a machine in my home network using nfs (nfs server running on desktop machine). I am using backintime (horribly slow) to do recurring, incremental rsync backups to that desktop machine.

Now, I am mounting the nfs share in fstab. But when the nfs server is not available, simply because I am out of home, or the nfs server is turned off, booting takes forever since it waits until the nfs mount times out.

How can I tell my system, not to mount, not even try when the nfs server is not available on the local network?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-05 18:22:38 -0500

ed209 gravatar image

You could either use autofs if you don't want to use fstab, or use systemd. For the latter case, in your fstab add the following line:

server:/from /mountpoint nfs noauto,x-systemd.automount,x-systemd.idle-timeout=1min 0 0

so that files under /mountpoint will be available only if server is alive, otherwise will be empty.

edit flag offensive delete link more
0

answered 2016-12-05 11:40:16 -0500

fcomida gravatar image

use the soft,retrans and timeout options even though are somehow dangerous because of possible data loss. See man nfs(5)

edit flag offensive delete link more

Comments

I could, but I really don't like the soft option. I may corrupt data, which is bad for the purpose of a backup.

gobigobi66 gravatar imagegobigobi66 ( 2016-12-05 12:06:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-05 09:47:20 -0500

Seen: 1,325 times

Last updated: Dec 05 '16