You are not logged in.

#1 2024-03-15 14:15:17

Epp
Member
Registered: 2022-07-11
Posts: 95

[SOLVED] Better way to auto mount not always turned on NAS

Hi hello,

My (only local) NAS is almost perfect for me. It’s my NAS and there is no need to share it with others. I mount the NAS device to my own home folder.

But, as I don’t use my NAS over the internet and I don’t need access to my NAS most of the time, I like the NAS to be turned off most of the time.

That's where almost perfect comes in.
When I started with the NAS before I became an Arch user my PC would hardly boot with the NAS turned off. I had to actually turn on the NAS to get my PC going.

Previous

192.168.178.18:/MyDisk/MyFolder /home/myname/Files nfs     defaults        0 0

If I remember correct this worked less great with my new Arch install.
So the defaults setting became noauto,x-systemd.automount

Actual

192.168.178.18:/MyDisk/MyFolder /home/myname/Files 	nfs	noauto,x-systemd.automount	0	0

The mounting process would no longer disturb the booting process.
But it has a downside.
When I turn on my PC with the NAS turned off and browsing my files with vifm, vifm is going to hang (when hitting the mount folder). There is nothing to do about that I think. Stopping vifm is hard. And I believe that even rebooting the PC will not stop the hanging vifm.

The only options then are powering on the NAS, or disabling the mount line in fstab.

Are there different settings I could try or is this just the way fstab mounting works with NFS and I have to take the Arch wiki for NFS literally?

3.2 Mount using /etc/fstab
Using fstab is useful for a server which is always on, and the NFS shares are available whenever the client boots up.

Perhaps manual mounting, or mounting with a custom script could work better with a not always turned on NAS?

Last edited by Epp (2024-03-15 17:14:30)

Offline

#2 2024-03-15 14:47:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: [SOLVED] Better way to auto mount not always turned on NAS

https://man.archlinux.org/man/nfs.5.en#soft

timeo=14,retrans=2,soft,bg

Play w/ the values depending on how good your connection to the NAS is.

You probably also want "noatime" (less traffic) and an x-systemd.device-timeout (drop on idle)


Edit: some ofthat is actually in the wiki, right below the cited section, https://wiki.archlinux.org/title/NFS#Mo … th_systemd

Last edited by seth (2024-03-15 14:48:52)

Offline

#3 2024-03-15 17:13:48

Epp
Member
Registered: 2022-07-11
Posts: 95

Re: [SOLVED] Better way to auto mount not always turned on NAS

Thanks Seth!

Mounting and filebrowsing is now as I think it should go. Without the mount there is just (and immediately) the empty folder. After turning on the NAS the NAS is mounted automatically.
Also thanks for the suggestions for further improvement.

In case somebody stumbles upon this post (searching for correct syntax):
This is now in my fstab:

192.168.178.18:/MyDisk/MyFolder /home/myname/Files	nfs	timeo=14,retrans=2,soft,bg	0	0

Offline

Board footer

Powered by FluxBB