Hi! I need to do some edits to fstab to auto mount smb shares from my home server.
Should I edit fstab in /etc/? If so, do edits to /etc/fstab persist between updates? From what I understand /etc/ should be a “normal” directory in atomic land.
Why would this be different than on a non-atomic OS, where you’d simply use noauto and user ? IDK if it’s perfectly matching the atomic pattern, but it’s probably an intended use. Why else would /etc be a layered thing if not to support and preserve existing configuration habits?
Hi again! Where do you place these files? I suspect /etc/systemd/system isn’t the right place? Do you use .mount + .automount files? Can you give a more precise example?
automount is for when you only want the mount to happen when you open the folder. You can see in my mount file that the trigger is network-online, i.e. it will automatically mount when my laptop has a network connection.
There’s nothing UBlue specific about this - just search on Google to read up on systemd user mounts.
I read your message after having done the stuff below. It seems to work after reboot. Do you see any problems with using the dirs I have used if they seem to work now? I’d like to survive a system update.
mkdir /var/mnt/serverstorage/
Saved var-mnt-serverstorage.automount in /etc/systemd/system/ with these contents:
I’m trying to follow this thread to get my NFS share auto mounted. It doesn’t seem to want to mount. Is your example only for SAMBA shares and won’t work with NFS, or am I missing something.
Below is terminal output when I manually run the symlink
./nas.mount: line 1: [Unit]: command not found
./nas.mount: line 6: [Mount]: command not found
./nas.mount: line 14: [Install]: command not found
Below is my .mount contents, I’ve tried all sorts of things but not having much luck.
Systemd mount files are not meant to be executed directly. You need to place them in a well-known directory (for example, /etc/systemd/system) and use systemctl enable.
Thank you again, that blog post was a big help. Following his sample of the .mount file I kept getting a no device error when trying to access. Eventually I corrected a typo in TYPE where I had it as NFS instead of nfs (not sure if that matters) then removed all the options from Options= field and now it works perfectly.
Ok, I’ve done systemctl enable on my .automount unit and am able to systemctl start and see my share. But after rebooting the unit doesn’t auto start. the symlink created when I enabled it is in /etc/systemd/system
Hi all, I use a different way of automounting my nas and find that very easy to setup.
I create the target folder in a terminal using: sudo mkdir /mnt/NAS
In /etc/fstab I add the following line: 192.168.x.xxx/:nfs/<Folder> /mnt/NAS nfs x-systemd.automount 0 0
Then, again in the terminal, I use: sudo mount -a
so all entries in the fstab file are mounted and I can start using the mount without the need of a reboot.
At reboot, because fstab is being read, the new mount will be mounted automatically.
That’s all. It works perfectly for quite some years already in different distro’s and version numbers.
I used to use the /etc/fstab to automount my NAS, but with the nature of Bazzite, an update to the main image will eliminate the change and then have to edit again. I might go that way though because what I’ve been trying hasn’t been working.