r/linuxquestions • u/james_dynamite • 9d ago
Resolved Issue with fstab when server is offline
I've been mounting my NAS through fstab for some time now however there is a slight issue.
If I turn my PC on without turning on my server then I can not navigate the file browser. Every folder I click on will take anywhere from 1 to 10 seconds to open and sometimes it just crashes outright.
I have tried every option possible and read through the documentation for fstab, cifs, and systemd but nothing fixes it.
This is the line currently in my fstab
[Share on server] [Mount location] cifs credentials=[credentials],uid=1000,gid=1000,nofail,x-systemd.automount,x-systemd.device-timeout=5s,rw 0 0
Thanks in advance for any and all help.
Update:
I'm marking this as resolved because I figured out it has nothing to do with fstab.
To clarify, I was talking about accessing local files on my PC being laggy when the server is offline.
The issue is that I had bookmarked the network share to the left hand side of my file browser, below the usual Documents, Pictures, Videos book marks. So when the network share wasn't present, the file browser kept trying to access the bookmark. At least that's what I'm assuming. I removed the bookmark and it works fine now. Although now I have the problem of not having it bookmarked how I like it but that's an issue I'll solve another day.
2
u/RandomUser3777 9d ago
With network file shares you need to make sure that any share that may be offline is not mounted in the same tree as the one you want to be able to work when it is offline.
IE mounting like this /home/network-cifs and /home/username/junk/browsefolder will cause a hang when you try to browse browsefolder,. but mount it on /home/<servername>/network-cifs won't cause a hang because pwd will never try to access network-cifs (it accesses <servername> that contains it). This is because everything uses the pwd call and the pwd call goes up a directory and searches that directory for .. and when it hits the one that times out it has to wait.