You are not logged in.
Pages: 1
I have a file server with nfs shares and I've been mounting those shares with fstab entry.
I recently discovered (via systemd-analyze) that my really slow boot times were a result of the file server not being available ( powered off.)
The server will not always be online, so how do I change my fstab entry to only mount when the server is available?
I do like having the ability to mount -a when I need to mount on the fly.
I've attempted to search for this info, but found myself in a mess of fstab vs. systemd automount vs autofs posts.
Thank you
Offline
What about specifying to your database that it is a "_netdev" or using systemd automount so it wont get mounted until you actually query it. What is it you have in your fstab currently?
Offline
My current fstab reads as follows:
Fileserver:/ /media/NFS_Shares nfs4 rsize=8192,wsize=8192,timeo=14,intr 0 0
Offline
I use autofs. Probably not the most shiny way of handling NFS shares, but it works. More info in the wiki.
Geek, runner, motorcyclist and professional know-it-all
Offline
Yes, autofs indeed. I have the following additional mount options on my nfs share:
...noauto,x-systemd.automount,nofail,_netdev
I have seen reports from many that their systems function just fine without "_netdev" but it is something that I have been using since I started using nfs. The nofail will simply do what it sounds like, if it is not present, it will not fail. So when I do get back onto my home network with the nfs share, I simply do
$ mount /mount/point
and it works. I also have the users option, so that I can mount as a normal user. I am not sure if this is automatic enough for you, but it works for my use case.
Offline
Yes, autofs indeed. I have the following additional mount options on my nfs share:
...noauto,x-systemd.automount,nofail,_netdev
To avoid confusion, it's worth mentioning that autofs and systemd automount are two completely different beasts.
when I do get back onto my home network with the nfs share, I simply do
$ mount /mount/point
FYI, the presence of x-systemd.automount in your fstab means you don't have to issue the mount command - it will automount whenever you try to access it.
Offline
I guess that would be the point of autofs wouldn't it... wow, I was doing it wrong the whole time!
Offline
TBH, I switched to autofs because the automounting and autounmounting did not work. NFS is fickle. YMMV.
Geek, runner, motorcyclist and professional know-it-all
Offline
Actually, autounmounting is still on the to-do list for systemd, so if you need that autofs is indeed your best choice.
Offline
Pages: 1