[SOLVED] mounting Synology partitions

Forum rules
Before you post please read this
Post Reply
mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

[SOLVED] mounting Synology partitions

Post by mirkoj » Thu Feb 28, 2019 4:12 am

Linux noob here so forgive on basic questions.

Finaly managed to get Maya up and running.
Now needd to be able to actualy load projects to work on.

I have an Synology NAS which servers as file server.
Got volume1 in there and could shared folders, which all works fine for windows, mapping drives, and stuff.

Now I would appreciate any guidance in how to mount those shared folders on linux mint 19.1 and also automount on boot would be great as well.
Was looking around but couldn't find a coherent working solution.
Thank you!

EDIT solution:

On Synology side, enable NFS in File Services, and then in Shared Folder, select the folder you need and Edit.
Under NFS Permissions, create and setup this:

Hostname or IP*: *
Privilege: Read/Write
Squash: Map root to admin
Security: sys

On Linux side:
$ sudo apt-get install nfs-common

create a mount folder, for example:

$ sudo mkdir /media/folder1

edit /etc/fstab to add line or lines for your shared folders:
<NAS-IP>:/<volume>/<shared folder> /<mount point> nfs rsize=8192,wsize=8192,timeo=14,intr

for exmaple: 192.168.100.100:/volume1/Homes /media/Homes nfs rsize=8192,wsize=8192,timeo=14,intr
after editing fstab run:

$ sudo mount -a
Last edited by mirkoj on Mon Mar 04, 2019 7:41 am, edited 1 time in total.

User avatar
AndyMH
Level 9
Level 9
Posts: 2511
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: mounting Synology partitions

Post by AndyMH » Thu Feb 28, 2019 4:53 am

My fstab entry:

Code: Select all

# mount point for synology NAS 
//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0
I've mounted it into /media, you can mount it where you like. The credentials file is a simple text file of the form:

Code: Select all

username=xxxx
password=xxxx
Once created change ownership of the credentials file to root, I also made it RO. You also need to install samba if not installed.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 5:15 am

No luck here :(

I replaced this first part assuming this is how it should look (my nas is called storage and have volume1 with shared folders on it, one of them being Work.
When I change fstab synology folder shows up but get error:

unable to mount synology
mount: /media/synology: operation permitted for root only

If I open computer as root then synology is shown in Devices but getting error:
Unable to mount synology
mount error(95): Operation not supported
Refer to the mount.cif(8) manual page (e.g. man mount.cifs)

This is what I used in fstab

# mount point for synology NAS
//storage.local/volume1/Work /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0

I do have credentials file created at that location so that should be fine.
By the way Synology does have support for NFS as well. I did enable it and created NFS permission on that shared folder.
Mount path is /volume1/Work
Is this usable by any way?


edit:
I did try this:
https://blog.tinned-software.net/linux- ... matically/

Installed nfs stuff
$ sudo apt-get install nfs-common

and tried mount:
$ sudo mount -t nfs <IP>:/volume1/Work /media/synology

It did mount something but when I try to open it I get:
The folder contents could not be displayed.
You do not have the permissions necessary to view the contents of "synology".

Opening computer as root and then I can see everything in there.
Figured to try and mount asn non sudo but the only root can use "--types" option :)

So I'm guessing I'm close but how to be able to access mounted folder now as non root?

User avatar
AndyMH
Level 9
Level 9
Posts: 2511
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: mounting Synology partitions

Post by AndyMH » Fri Mar 01, 2019 6:46 am

I've not had much luck trying to mount through NFS, although it is some time since I tried, but in this post there is an fstab line that works:

viewtopic.php?f=53&t=289149&p=1601992&h ... y#p1601992

Did you change ownership of the credentials file to root? Last time I saw this problem, that was the cause. You can try replacing credentials=/etc/samba/credentials with username=xxx,password=xxx in your fstab line.

Did you explicitly change the name of the synology because diskstation.local is what you get 'out of the box'? You can try replacing the name with the IP address, e.g. replace storage.local with 192.168.0.5 (IP address where mine is).

Here is another post on the subject, which version of DSM are you running?:

viewtopic.php?f=150&t=287853&p=1595342& ... y#p1595342
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 6:59 am

looking at properties of credentials file, owner is root, access read and write
group root, access read only
Is that what you had in mind?

I checked and figured out that location is storage.local
But I had two Storage (File Sharing) when I goto network and Windows Network in tehre as well
one when I go to properties said it is storage.local and the other just Storage

So tried both and voala!
# mount point for synology NAS
//Storage/Work/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0

This is what worked at the end.
Adding the rest of folders is straight forward.

Thank you for time and help, takes a bit digging due to these small differences but at the end... has to work :)

If I may ask for jstu a bit extra of your time and to sort out option to keep these mounted, or they will be mounted all the time now when it is in fstab?

edit:
also do I need to do some extra stuff in order to see that in list for my 3d app or any othejr program?
Annotation 2019-03-01 120029.jpg
Tried all of these no idea how to locate newly mounted location on NAS?

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 7:25 am

Ok still not good actually.
I just mounted that as before. fstab part is not working.

If I open COmputer as root, and put this in fstab "Work" shows up in devices:
# mount point for synology NAS
//Storage/Work/ /mnt/Work cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0

But I cannot open it as root, and as normal user there is no Work in there at all, I can only mount it as it dose automatically when I open network location..
So actually still have to dig this.

I'm supposed to edit fstab as root right??


EDIT:

Ok got it with fstab lines:
# mount point for synology NAS
//storage.local/Work/ /mnt/Work cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0

And can access it as root.
It was SMB3 settings missing in synology nas SMB advanced settings, I had it with smb1 and smb2 as min max. changed to smb3 as max and can access it now as root.
Now question is.. well I dont see it mounted as non root user.. buit getting closer :)

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 7:38 am

So here I am at the moment.

As a root, I see Work in Devices and can access and all. All good there as it seems will see what happens after a reboot.

As a normal user, ie myself I don't see it there. Maybe that is why I don't see it in maya program too...
Is there an additional step to do?
Attachments
Annotation 2019-03-01 123641.jpg

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 8:14 am

And this
I run into this so figured to try:

https://blog.whabash.com/posts/mounting ... untu_16_10

This got me closest possible to solution so far. Only thing is when I mount folders I cannot access them as normal users, only as a root. Getting message: The folder content could not be displayed. you do not have the permissions necessary to view the contents of <folder>

edit: in synology NFS permissions squash had to put from root to admin .. something like hta.. seems like I can access them now as normal user as well...

Seems like a lot of talking to my self but wriintg as I go.. once I get it all done I can put in top post solution and all compressed in nice explanation maybe will help otehrs as well :)

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 8:39 am

Got it!

Finally have it all working and rather straight forward at the end.
Well, I have no idea what bunch of stuff added in fstab means but it works!

Will put together short version of guide as some details were missing in the link provided bellow :)

Thank you again for your time was a big help for me stumbling in the dark :)

User avatar
AndyMH
Level 9
Level 9
Posts: 2511
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: mounting Synology partitions

Post by AndyMH » Fri Mar 01, 2019 12:59 pm

Glad you got there in the end. It was the same for me, a process of trial and error until I got something that worked but not really sure why. Having made the changes to fstab, it is permanent and the NAS will be automatically mounted on boot. One thing you might do is add nofail to the fstab options. I haven't bothered, but what it means is that if the NAS isn't present on boot it will just carry on and boot as normal. Without it I think you are into a 90s delay in boot while it tries to reconnect before it gives up.

Yes you did what I wanted on ownership of the credentials file.

If you got it working with NFS I'd like to see what you put in your fstab, as I said tried and failed there so used cifs (and somewhere along the line got some help from @altair4, our guru on all things networking, particularly samba). :D
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Fri Mar 01, 2019 1:28 pm

192.168.100.12:/volume1/P /media/Storage/P nfs rsize=8192,wsize=8192,timeo=14,intr

This is what I have in fstab, I've created folder Storage in media and inside Storage will be mounting all the needed stuff from NAS.

On Synology side, enable NFS in File Services, and then in Shared Folder, select folder you need and Edit.
Under NFS Permissions, create and got this:

Hostname or IP*: *
Privilege: Read/Write
Squash: Map root to admin
Security: sys

And that is all.
I did create user on my Synology NAS that matches user and password of user on linux machine, not sure if that had any help but did that while was trying to sort out those permissions stuff, but I don't think that has to do anything with this as I was still getting permission issue until I set up NFS permissions properly.
Will put a bit more details all with images just to get a bit better, after all the troubles, picked up some stomach virus as well so.. go figure...
Actually rather don't :)

RemonK
Level 4
Level 4
Posts: 249
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: mounting Synology partitions

Post by RemonK » Mon Mar 04, 2019 6:46 am

I have the same problem, so i'll wait on your guide! ;)
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: mounting Synology partitions

Post by mirkoj » Mon Mar 04, 2019 7:39 am

So in a nutshell what I just described up there:

On Synology side, enable NFS in File Services, and then in Shared Folder, select the folder you need and Edit.
Under NFS Permissions, create and got this:

Hostname or IP*: *
Privilege: Read/Write
Squash: Map root to admin
Security: sys

On linux side:
$ sudo apt-get install nfs-common

create a mount folder, for example:

$ mkdir /media/folder1

edit /etc/fstab to add line or lines for your shared folders:
<NAS-IP>:/<volume>/<shared folder> /<mount point> nfs rsize=8192,wsize=8192,timeo=14,intr

for exmaple: 192.168.100.100:/volume1/Homes /media/Homes nfs rsize=8192,wsize=8192,timeo=14,intr
after editing fstab run:

$ sudo mount -a

Please let me know if it is straight enough or it can use some cleaning to be straight to follow, I will edit as needed.

RemonK
Level 4
Level 4
Posts: 249
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: mounting Synology partitions

Post by RemonK » Mon Mar 04, 2019 4:04 pm

mirkoj wrote:
Mon Mar 04, 2019 7:39 am
On Synology side, enable NFS in File Services, and then in Shared Folder, select the folder you need and Edit.
Under NFS Permissions, create and got this:

Hostname or IP*: *
Privilege: Read/Write
Squash: Map root to admin
Security: sys
I think here it goes wrong for me. I have not the same NAS and have not the last 2 options.. squash and security.
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek

mirkoj
Level 3
Level 3
Posts: 113
Joined: Wed Feb 28, 2018 4:17 pm

Re: [SOLVED] mounting Synology partitions

Post by mirkoj » Mon Mar 04, 2019 4:24 pm

maybe can look on your NAS forum if there is similar option, it didn't work for me until lI didn;t change that Squash map root to admin stuff

RemonK
Level 4
Level 4
Posts: 249
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: [SOLVED] mounting Synology partitions

Post by RemonK » Mon Mar 04, 2019 9:04 pm

I got my NAS root mounted in fstab with SSH that was the easy part.... the hard part is mounting the simple samba shares!? :roll: :oops:

Code: Select all

USER@IPHOST://media/USER/NAS_Root fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/USER/.ssh/id_rsa,allow_other,reconnect 0 0
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek

bodycount28
Level 1
Level 1
Posts: 6
Joined: Mon Mar 04, 2019 3:49 pm
Location: California

Re: [SOLVED] mounting Synology partitions

Post by bodycount28 » Tue Mar 05, 2019 1:25 am

I mounted Synology SMB shares using Altair's tutorial utilizing autofs: viewtopic.php?f=42&t=144997&hilit=samba. I prefer this over persistent mapping through fstab as it is more dynamic and will disconnect when not in use, based on your timeout setting.

Synology uses SMB1, therefore you'll need to add the following to each mapping statement:
ShareName -fstype=cifs,rw,credentials=/home/altair/secret.txt,uid=1000,iocharset=utf8,vers=1.0 ://server/share
Ideally you'd want to use SMB2 or SMB3, however I don't think Synology plays nice with either, I'm still testing it out and haven't gotten it to work.

BTW - As you see, I'm a newbie to Linux, however fairly experienced in networking...

PS - Kudos to Altair's posts, I've learned a lot so far!

RemonK
Level 4
Level 4
Posts: 249
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: [SOLVED] mounting Synology partitions

Post by RemonK » Tue Mar 05, 2019 2:26 pm

Thank you for the tip and the link, i succeeded with autofs! :D
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek

WeyldFalcon
Level 1
Level 1
Posts: 5
Joined: Sun Sep 01, 2019 9:13 pm

Re: [SOLVED] mounting Synology partitions

Post by WeyldFalcon » Fri Sep 06, 2019 10:32 am

When you put
Hostname or IP*: *
are you saying any client can connect?

Also curious how you got around
mount.nfs: access denied by server while mounting 192.168.1.x:/volume1/foldername

User avatar
AndyMH
Level 9
Level 9
Posts: 2511
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: [SOLVED] mounting Synology partitions

Post by AndyMH » Fri Sep 06, 2019 2:30 pm

Synology uses SMB1
Not on mine, DS216j, I have a choice:
Workspace 1_027a.png
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

Post Reply

Return to “Mounting Partitions”