Mint 19 - Synology NAS - Mount at startup with local user:group and 755

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
windowsisdeadtome

Mint 19 - Synology NAS - Mount at startup with local user:group and 755

Post by windowsisdeadtome »

Hey All,

I've got a NAS drive with a few shared folders on it and I've never really been able to get the permissions quite right, so I'm turning to your folks in the hopes I can finally get it nailed down.

Ultimately, what I want is:
  1. Mounted folders/files to be owned by my user:group
  2. Mounted foders/files to be set at 0755 (I don't want 0777 as the folders get highlighted in green)
  3. Files and Folders created on mount drive are created as my user:group and set as 0755
  4. Files and fodlers created during npm, laravel, other cli dev tools, sab, sonarr and other various tools are created with the same permissions as #3
This is my current FSTAB entries:

Code: Select all

stargatecommand:/volume1/Movies /home/oneill/media/movies      nfs     auto,defaults,nofail    0       0
stargatecommand:/volume1/TV-Series /home/oneill/media/tv      nfs      auto,defaults,nofail    0       0
stargatecommand:/volume1/My\040Documents /home/oneill/media/Documents      nfs      auto,defaults,nofail    0       0
stargatecommand:/volume1/Dev-Server /home/oneill/media/dev     nfs     auto,defaults,nofail    0       0
stargatecommand:/volume1/Servers /home/oneill/media/servers    nfs     auto,defaults,nofail    0       0
The weird thing is my dev/Documents/servers folders are mounted as "root" and my movies/tv folders are mounted as my user "oneill".
The permissions on these folders are 0777

BUT when I CD into one of these folders, the user:groups are different depending on how the file/folder was created.

For example:
  • Some fodler permissions are 1027:users
  • Other folder permissions are 1029:users
  • And other folders permissions are 1026:users
  • the . is owned by root:root
  • the .. is owned by oneill:oneill
I'e done a lot Google searches and read a lot of forum threads, blogs, manual pages, etc... and apparently CIFS is an old way to mount drives, but SAMBA is the better route. I've added an additional line in my FSTAB to try a samb mount but it doesn't like my hostname stargatecommand so I need to use the IP address (I don't like this option as I want to manage all my DNS via my hosts file - or if there's a better way??)

So when I change the SAMBA FSTAB entry, I get an error:

Code: Select all

//MY.IP.ADDRESS/volume1/Servers /home/oneill/media/servers cifs credentials=/home/oneill/.smbcredentials,rw,uid=1000,gid=1000,nounix,vers=1.0,iocharset=utf8,file_mode=0755,dir_mode=0755 0 0
When sudo mount -a, I get this error:

Code: Select all

○ → sudo mount -a
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I'm not opposed to NFS, CIFS, SAMBA as long as I can get these folders mounted as defined in the list at the beginning of my post. Any help would be greatly appreciated!

Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Mint 19 - Synology NAS - Mount at startup with local user:group and 755

Post by altair4 »

I haven't used NFS since the Korean War ended and I do not have your NAS so we will see how much my advice is worth.

Regarding your cifs mount:
//MY.IP.ADDRESS/volume1/Servers /home/oneill/media/servers cifs credentials=/home/oneill/.smbcredentials,rw,uid=1000,gid=1000,nounix,vers=1.0,iocharset=utf8,file_mode=0755,dir_mode=0755 0 0
** CIFS has gotten persnickety about network paths of late so unless "volume1" is the shared entity on the nas you are not syntactically correct. Try //MY.IP.ADDRESS/Servers instead.

** The Linux Kernel you are using will negotiate with the server the smb dialect it uses between 2.1 to 3.02 - that's equivalent to vers=2.1 and vers=3.0. Depending on how old or at least how long ago you updated the NAS software you might consider removing the vers=1.0 option from the mount statement as a test.

It's my understanding that you have control over which smb dialect the NAS can use: viewtopic.php?t=241693#p1293736

** I don't know how your hosts file will interfere with this but the Synology NAS was apparently designed to play well with macOS clients which is always good news for Linux. You should be able to replace //MY.IP.ADDRESS with its mDNS qualified host name: //DiskStation.local or I guess in your case //stargatecommand.local.

You might want to ping it by that name to make sure - unless the NAS blocks ping requests:

Code: Select all

ping -c3 stargatecommand.local
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
windowsisdeadtome

Re: Mint 19 - Synology NAS - Mount at startup with local user:group and 755

Post by windowsisdeadtome »

For reference, my NAs is a DS1817+, half a year old and it gets updated automatically.
I haven't used NFS since the Korean War ended and I do not have your NAS so we will see how much my advice is worth.
Interesting this is an old way to mount, literally hundres of articles online reference nfs when mounting, so that's why I went with it.

As for the CIFS, I did the following:
- removed the vers attribure
- added the host as //stargatecommand.local

When I mount via sudo mount -a I get mount error(95): Operation not supported.
I did read that with SMB, I don't need the volume1 in the mount, so I removed that, but still get the same error as above.

So I then read that vers is actually needed in some cases, I tried with vers=3.0, I got mount error(95): Operation not supported.
//stargatecommand/Servers /home/oneill/media/servers cifs credentials=/home/oneill/.smbcredentials,rw,vers=3.0,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0755,dir_mode=0755 0 0

But when I changed to vers=1.0, I get mount error(2): No such file or directory
//stargatecommand/Servers /home/oneill/media/servers cifs credentials=/home/oneill/.smbcredentials,rw,vers=1.0,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0755,dir_mode=0755 0 0

I know the directory does exists, when in the folder and running pwd:

Code: Select all

   SG-1-Prometheus in ~/media/servers
○ → pwd
/home/oneill/media/servers
But when I tried the below, I got the same mount error(95): Operation not supported.
//stargatecommand/volume1/Servers /home/oneill/media/servers cifs credentials=/home/oneill/.smbcredentials,rw,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0755,dir_mode=0755 0 0
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Mint 19 - Synology NAS - Mount at startup with local user:group and 755

Post by altair4 »

Don't know what to tell you.

I did find a synology DSM simulator on the web: https://demo.synology.com/en-uk/dsm

If I go to Control Panel > File Services > SMB Tab > Advanced Settings I see this as the default:
SynologyDSM.png
By default in Mint19 cifs will not connect via SMB1 and SMB2 may or may not be a problem because cifs will start with the SMB2.1 dialect not the SMB2.0 dialect.

I don't know if ping -c3 stargatecommand.local worked for you or not so just to remove outside variables in this issue I would go back to using the ipaddress of the nas.

If you leave the nas at what the simulator shows as the default:

Change your mount expression to include the vers=1.0 option first.
Then try it with the vers=2.0 option

If you change the NAS "Maximum SMB protocol" to SMB3 you shouldn't need any vers option in fstab.

The only other potential problem may be where you put your credentials file. Is you home directory encrypted?

All of this seemed to work in this post so I am not sure what the issue is here.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Networking”