the folders are mounted correctly in the mounting points in /mnt/.
That is a perfect start to automatically mounting your Synology shares on Ubuntu. However, when I tried using /mnt/ on my 24.04 instance I encountered an issue which was resolved by using the directory /media
which is reflected in the code below (creating the sub-directories for the shares below that as shown).
From there in /etc/fstab create the following entries (based on your provided information in the context of the entries I have in my fstab file):
//nnn.nnn.n.nnn/volume1/data /media/nas_media cifs username=xxxxx,password=xxxxx,rw,uid=1000,gid=500
//nnn.nnn.n.nnn/volume1/games /media/nas_games cifs username=xxxxx,password=xxxxx,rw,uid=1000,gid=500
//nnn.nnn.n.nnn/volume1/youtubing /media/youtubing cifs username=xxxxxx,password=xxxxxx,rw,uid=1000,gid=500
Write out the /etc/fstab file with Ctrl+O after which return to the terminal with Ctrl+X in order to attempt to mount the shares.
Try the mount with sudo mount -a -v
in terminal (-a means all and -v means verbose).
You should then be able to see that the shares are mounted in the Nautilus left panel.
If you want to see the shares on your desktop (as I have in the image below) install (if not already done so) Extension Manager
and Desktop Icons NG (DING)
use the cog wheel and set Show external drives in the desktop
to ON and other options as desired.
Of course, replace nnn.nnn.n.nnn
with your NAS IP address and also xxxxxx
with your actual usernames and passwords for the Synology shares from your device.
It should be noted that my Synology NAS is formatted Ext4
in an SHR Raid configuration (the OP's is NFS) so different mount entries may be required accordingly.
In the end, these entries in fstab
worked for the NFS system format.
nnn.nnn.n.nn:/volume1/data /mnt/nas_media/ nfs defaults 0 0
nnn.nnn.n.nn:/volume1/Games /mnt/nas_games/ nfs defaults 0 0
nnn.nnn.n.nn:/volume1/youtubing /mnt/youtubing/ nfs defaults 0 0
It may also benefit you to make a backup copy of your existing fstab file.
/etc
is not appropriate at all to store user scripts,/etc
is meant to store global configuration files (use something like~/bin
to store user scripts).crontab -e
(user crontab) +sudo
isn't the way to schedule tasks that require elevated permissions - there's no way for sudo to authenticate you without an interactive shell. You'd want to use root's crontab (sudo crontab -e
) or - better - the system-wide /etc/crontab instead.sudo crontab -e
. As for the system-wide crontab, I wrote/etc/crontab
in my terminal but nothing happened.