问题原文
原帖链接 · Pie Faced · CC BY-SA 3.0
I have a NAS. On my Linux desktop, I mount a partition of the NAS via NFS.
The NAS isn't always switched on. When I need to use it, then I switch it on and use mount -a on my desktop.
The related entry on my /etc/fstab is:
192.168.1.110:/mnt/HD/HD_a2 /mnt/nas nfs rw,noatime,nodiratime 0 0
When the NAS is switched on, mount -a works fine and mounts the NAS partition.
However, when the NAS is not switched on, mount -a would hang, for very long (I'm not sure if it ever returns...). At this point when I switch on my NAS, the mount will succeed and return.
How can I get mount -a to return (without mounting the NAS partition of course) if the NAS is not switched on instead of waiting?
已采纳解答
原帖链接 · Sergiu Tot · CC BY-SA 3.0
If you want to use fstab, you can use the timeo parameter. But it's not the most elegant way to do it.
autofs is the proper way to handle NFS shares. You can find a good start here:
If you have trouble configure it, just let me know where you got stuck.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
