大网数据广告活动
服务器运维问答

How to STOP nfs from trying (and retrying) to mount an offline server

· 52CE 我爱测

I have a home server running ubuntu which exports a nfs volume which I'm mounting on my laptop like this -> % cat /etc/fstab ... media:/mnt/data /home/alf/media nfs _netdev 0 0 All is good. ..until I boot up my laptop at work (or…

问题原文

原帖链接 · Fractalf · CC BY-SA 4.0

I have a home server running ubuntu which exports a nfs volume which I'm mounting on my laptop like this

-> % cat /etc/fstab
...
media:/mnt/data /home/alf/media   nfs   _netdev     0 0

All is good.

..until I boot up my laptop at work (or any place except my house). Then booting hangs for a couple of minuttes trying to mount this volume which obviously isn't available. Very annoying.

I've (quick) read pretty much the whole nfs man page and searched high and low for a way to say to nfs: "look man, if you cannot reach my server, just skip it and move on, ok?", but I just can't find a way to do this.

Any suggestions? :)

已采纳解答

原帖链接 · shodanshok · CC BY-SA 4.0

You can try setting the retry parameter to 0:

media:/mnt/data /home/alf/media nfs _netdev,retry=0 0 0

From nfs man page:

retry=n The number of minutes that the mount(8) command retries an NFS mount operation in the foreground or background before giving up. If this option is not specified, the default value for foreground mounts is 2 minutes, and the default value for background mounts is 10000 minutes (80 minutes shy of one week). If a value of zero is specified, the mount(8) command exits immediately after the first failure.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-06-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。