Could I get please get some help with fstab entries for mounting my Synology NAS

This is one area (of many) that I really struggle with Linux compared to Windows. In Windows I can just map a drive to my NAS and job done. However, fstab is far too technical with all the options. It’s overwhelming for a casual user like me.

So I have a shared folder on my NAS that I would like always mounted on Fedora. Note that the NAS may not always be on when I turn my PC on so fstab entry needs to cope with that. I probably want to go with smb rather than nfs because, from what I read, nfs requires the Fedora user to have the same user id as the user id on the NAS and that just gets far too techy for me.

What I am thinking of using at the moment looks like this

//xxx.xxx.x.x/myshare /home/user1/myshare cifs noserverino,nofail,cache=strict,vers=3.0,credentials=/etc/.smbcredentials,iocharset=utf8,uid=1000,gid=1000,file_mode=0640,dir_mode=0750,rw 0 0

I am not really sure if I need all those options or something else though to be honest. It’s just from what I read on the internet.

I use SFTP and SMB over GVFS like this:

nautilus sftp://user@host
nautilus smb://host/share

Then add it to bookmarks: Ctrl+D

Does this work for you?

1 Like

No because I need a mounted folder so I can use Cryptomator to decrypt a folder on it. So I need a fstab entry.

With a bit more research I now have this potentially. Is this sufficient?

/NAS_IP/share_name /home/user1/nas cifs credentials=/etc/samba/credentials,_netdev,auto,vers=3.0,iocharset=utf8,uid=1000,gid=1000 0 0

Should you have issues when the NAS is not on, you can also add the nofail flag, though _netdev is probably covering that setup as well.

2 Likes

This unfortunately isn’t working. It works fine if I startup my PC after the NAS is on but it doesn’t work if it isn’t. The machine boots fine but the mount doesn’t start working after the NAS does come on. What I want to happen is that I click on it in the Files app and it then connects.

Try adding this option:
systemd.mount: Mount unit configuration | Man Page | File Formats | systemd | ManKier

You can try adding the x-gvfs-show flag.

Alternatively you can set it up in GNOME Disks. With the default settings on, GNOME would mount the NAS on user level (so no fstab entry).