fstab option timeo=# do not work as one would expect, think I found an error and a workaround.

Beside my PC with leap I have a QNAP NAS (some kind of linux) I mount the nas drives during boot.
(Mount cannot be manual as my wife can only use simple gui stuff, also I want access when I start the PC .
As the PC is not used everyday we turn it off every time we are done, this also minimize the risk of being hacked.
(Linux is very safe but it is also dual boot with windows etc)
We had the problem that if the NAS for some reason could not be mounted (I had bad network cable but also solve that today), the boot process hang for about 8 minuttes.
Totally unacceptable for both of us.
The mounts commands are the last entries in /etc/fstab.
After some reading I found that I could the add the option timeo=# where # should be seconds or 1/10 of seconds, depending on which documentation you read.
Yes it did work partly, the default value of 600 that mount command shows after mounting, could be changed, but it still hang for more that a minute even with a value of 1!
I searched the net and tried for about 4 hours. I found the x-systemd.device-timeout command, did not help.

Finally I found a secret option: retry.
If I set retry=1,timeo=5 I get about 65 seconds timeout!,
If I set fstab mount option retry=0,timeo=5 I actually get the 5 seconds timeout. I have verified for both manual mount and reboot.

I can see from my searches that many people have had similar problem and some never got it solved.
I think somewhere in the code (properly some kernel code used by multiple distros ) ithere is an error that always use a minimum value of 60 seconds for mount retries instead of the timeo value set by the user.

I am just a newbie soMy question is, am I right?
Does setting retry=0 have potential ugly side effects, another solution I found was using soft instead of hard mount, but I did not like the potential side effect of failed writes reported as ok:\

Apart from the fact that I can not find the timeo=, nor the retry= option in the man pages of fstab and mount, maybe the following description of how I handle a similar case might help.

I have an NFS mount from system A on system B, where it is not guaranteed that system A is up and running when system B boots.

To avoid hanging of B at boot time, I have the noauto option in B’s fstab.

Because one of course wants the file system becoming mounted asap when available, root has a crontab entry that runs every minute. The script basicaly does the following:

  • checking if already mounted, when yes: exit (doing this once a minute requires in fact nil resources);
  • check if system A is running (using ping), when yes: do the mount.

When you think this might be interesting, I can post the whole script (only a few lines).

timeo value has absolutely nothing to do with retry parameter. Your example works exactly as documented; please read “man 5 nfs” about what timeo and retry do.

Ah, I was already suspicious about the the title of he thread : fstab option timeo=# do not work as one would expect.

Without any further info about what the OP found as documentation where he bases his expection on.

That is why I posted that I could not find any info about those options, to trigger him to post that info. It is now clear that , as I did, only searching for those words in man fstab and man mount, is not enough to find it. But man mount clearly points to man 5 nfs.

Sorry for not digging deep enough in the man pages.

Yes it way the way it is intended, but:
Sorry the man pages are hardly readable for me. If you do not have a general overview of what to search for they are impossible to use.
Let me say it this way, I was looking for a way to mount the NAS at boot, so that boot do not get delayed for minuttes?
I tryed all the possible thinks I could find including noauto etc etc etc, nothink worked.
The ONLY way I could make it work as I want was using this retry=0
If you can tell me how I should do it then please do?

What do you mean with: noauto does not work? It is part of the solution I offered in post #2 above and it works of course.

Please never say “it does not work” without any evidence going with it. Thus show your fstab entry, and tell what happens that make you think “it does not work”.

You started with claiming that you found a bug. This sets the bar high enough.

The ONLY way I could make it work as I want was using this retry=0

Fine. So you have found solution to your problem.

If you can tell me how I should do it then please do?

What’s wrong with doing it as you do it now?

Sorry I should have formulated the title differently. I should not claim there is an error.As you say it may works as intended.
But then the intended way differs from how many nonexpert by intuition thinks it should work
Actually I am still not sure if timeo option is for mount or data RW or both. And whether the timeo counts seconds or 1/10 seconds or ?
nor if the retry option is only for mount or also for data write?
If the retry option also change how write works, is there a risk of data writes fails without the user get warned?

My point is:
From my web searches it seems like a number of non expert users like me have this problem quit often.
When I say noauto do not work, I mean on my computer, they way I (and many other non expert users want it to work).

What we want is that the NAS server NFS filesystem is mounted at boot if the NAS is present and network to it works.
If for any reason the mount fails, we do not want the desktop boot to hang for minuttes while doing mount retries, we want it skip the mount and continue within a few seconds. I have failed to find anyone or documentation describing how to do this.
Imaging when I started to mount the NAS I did not even know to press the ESC key to see what why it hangs, then you get very frustrated.
The doc is properly there, just to hard to find and understand.

After my 4 hours search and endless numbers of trial I found that retry=0 was the only solution that works as described above.

That is what nofail is for to allow boot even if the partition is missing in action

It is both. It is (RPC) request timeout.

And whether the timeo counts seconds or 1/10 seconds
I know only 1/10th of second but of course it could have been different at some time and the problem of relying on search is that often you do not even see when text was written.

nor if the retry option is only for mount or also for data write?
The “number of minutes that the mount(8) command retries an NFS mount operation” looks rather unambiguous to me.
I found that retry=0 was the only solution that works as described above.

Fine; everyone has different requirements, so you have found solution to yours.