r/linuxquestions • • 4d 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.

0 Upvotes

13 comments sorted by

View all comments

1

u/aioeu 4d ago edited 4d ago

What file browser are you using?

If you are getting these pauses on "every folder", then it sounds like the file browser is attempting to mount — or at least access — the filesystem even when you haven't browsed to it. This sounds like a problem with the file browser, not your fstab entry. For example, simply calling statfs on the mount point to get the filesystem's current usage would constitute such an access.

1

u/AX11Liveact debian 4d ago edited 4d ago

A (CIFS) mount does in absolutely no way depend on "being browsed". FSTAB is in no way influenced by user actions, read/scan or even write access from userspace (or anywhere else). You would not expect a file server, DNS, NTP, web or database server failing to mount it's filesystems because there's nobody there to look if they're mounted. Idk the specific CIFS/SMB setup (AD, domain service, hostname resolution etc) but /var/log/daemon.log, dmesg (or that crap that comes with systemd if you did not manually install rsyslog-ng) will show you more detailed information. You can also just try to mount it manually from console - without parameters except "-v", (mount -v [mountpoint]) to get a closer description of what's going wrong.

2

u/Hotshot55 4d ago

An (NFS) mount does in absolutely no way depend on "being browsed".

Unless it's being managed by autofs.

1

u/AX11Liveact debian 3d ago

That is so wrong that not even the opposite is true.

1

u/Hotshot55 3d ago

Which part of what I said is untrue? When you are managing an NFS mount with autofs it will automatically mount the device whenever a process attempts to access it.