UPDATE:  As of Ubuntu 13.04, these directions no longer work.  I figured out a way to get this to work, however.  See the updated directions at the bottom of this post.

——————Old Directions————————————

If you’d like to share your network attached storage from a Synology file server with your Linuxmint or Ubuntu machine and have it appear as just another folder, you can set the Synology unit to automount on your computer.  These steps assume that you have already set up your Synology unit and are sharing at least one folder over the network.  It also assumes that you are already connected to the same local network as your Synology unit.

To set up the automount, do the following:

1) Install the package nfs-common, either using synaptic or the command line:

synology-01

(from the command line: sudo apt-get install nfs-common)

2) Open a console or terminal and type “ifconfig” to find out your IP address on your local network.

synology-02

 

Let’s assume your IP on the local network is 192.168.2.1 (as shown in the figure).

3) Open the Synology interface and then open the Control Panel:

synology-03

4) Click on “Shared Folder” which will show you a list of your shared folders.  Synology comes with the ability to share folders using the nfs protocol.  It is a secure protocol that requires you to add the IP address of the computer that is going to be allowed to access files on the Synology NAS.  Once you see the shared folders, select the folder you want to share, then click on “Privileges” and then “NFS Privileges”.

synology-04

 

5) In the next window, click on “Create” and then add the IP address of the computer with which you want to share that folder.  You should also decide what privileges you want to grant that computer.  If you grant it read/write privileges, that computer can modify files.  If you grant it the read privilege, that computer can only read files.

synology-05

6) Once you’ve done that, you should be able to access the shared folder over your network.  However, what we want to do is make any shared folders automatically mount over the network every time you start your computer.  To do so, you’ll need to do two more things.  First, create a folder on your computer to map the shared folder to.  An ideal location is in your home folder since you already have read/write privileges there.  So, for instance, if you are sharing photos over the network, create a folder in your home directory called “NASphotos” by doing the following from the terminal (or just create it in a file explorer): mkdir /home/user/NASphotos

7)  Next, you’ll need to edit your /etc/fstab file.  To do so, open a terminal and type: sudo kate /etc/fstab

(You could also use gedit or some other text program, like nano.)

8) This should open the /etc/fstab file in a text editing program.  You’ll need to add the following lines to your /etc/fstab file:

Any line that starts with the pound sign “#” is a comment line.  I like to add a comment line so I know what my command is doing.  Here’s the line I add:

# automount file synology

Next is the line that actually does the work:

     192.168.2.100:/volume1/photos /home/user/NASphotos nfs nouser,rsize=8192,wsize=8192,atime,auto,rw,dev,exec,suid 0 0

You’ll need to change the parts that are bolded.  The IP is the IP of your Synology unit on the network.  If you have a different name for your volume on your Synology unit, you’ll need to change “volume1” to whatever it is.  Replace “photos” with the name of the shared folder on your Synology unit.  Replace “user” with your username.  And replace “NASphotos” with whatever folder you created in step 6.

Save the file and close it.

8)  Now, assuming you’ve done everything correctly, type the following into a terminal to mount the shared folder: sudo mount -a

Your shared folder should now show up in your file explorer (e.g. Dolphin) and should do so every time you start your computer.  Depending on the privileges you granted yourself on the Synology NAS, you should be able to read and/or write whatever files you’ve stored on the Synology unit as if they were on your own computer.

 

——————————————New Directions—————————————

UPDATE: As of Ubuntu 13.04, the directions I gave above stopped working. After tinkering with the settings for a while, I found a way to make it work.  Follow all of the above steps.  However, when you edit the fstab file, try using the following format for each share you want to mount:

192.168.2.100:/volume1/photos /home/user/NASphotos nfs rw,hard,intr,nolock 0 0

This is working for now.  This was based on this article on the ubuntu help site.

97 Replies to “LinuxMint or Ubuntu: How to Automount Synology Shares”

  1. For all of you still fighting this… Here is a yahoo Tut that I followed in less than an hour and it worked first time. I have 2 of the Synology units, a DS215J and DS216j with 5 and 6 TB RAID inside. I am using Ubuntu 16 and all my folders are showing up great.

    https://www.youtube.com/watch?v=4a1_s4J87b4

  2. I have tried to mount one of my Synology DS716+II shared folder, say “folder1”, the folder do appears on the Nautilus file manager (ZorinOS12.1, based on Ubuntu16.04 core, GNOME desktop), but failed with the following error:
    ===================================
    Cannot access “folder1”
    mount: only root can mount 192.168.2.100:/volume1/photos

    on /home/user/NASphotos
    ===================================
    -> so what should I do to solve the access right issue?

    Thanks for any kind of help!

    1. when I issue the command “sudo mount -a”, the following error is displayed:
      =====================
      mount.nfs: Protocol not supported
      =====================

      Am I right that I have NOT been setting up the nfs-common properly?
      -> if this is the case, how can I correct this?

      Thanks for any kind of help!

      1. I reboot the client PC and “sudo apt install nfs-common” again
        -> this time “sudo mount -a” produce no errors
        -> and the shared folder can be mounted properly NOW

        Thanks Ryan for writing this great article!

  3. The solution does not work for me, trying to connect Ubuntu 16.04 (64bit) to DS214play.

    I get the following error:
    sudo mount -a
    mount.nfs: Connection timed out

    1. I found the problem: the IP-address had changed. However, after fixing this problem, a new one occurred:

      sudo mount -a
      mount.nfs: access denied by server while mounting :/volume1/folder

      1. I got a similar error today:
        ==============================
        mount.nfs: access denied by server while mounting 192.168.1.252:/volume1/folder01

        ================================
        -> after “sudo mount -a”

        If I click on the corresponding bookmark “folder01” on the left-panel of Nautilus File Manager, the error is:
        ===================================
        Cannot Access “folder01”

        mount: only root can mount 192.168.1.252:/volume1/folder01 on /home/user01/folder01
        ===================================

        Any way to solve the problems?

        Thanks for any kind of help!

        1. My initial thoughts:

          1) Have you installed nfs-common?

          2) In the Synology interface, have you insured that you enabled NFS privileges for the computer’s IP that is accessing the shared folder?

          3) Do you have read/write/execute privileges for the mounted folder? (CHMOD) And do you own it? (CHOWN)

          I think those three things are the most common problems. If you’ve solved all of those, double check IP addresses.

          1. Thanks Ryan!

            I finally find out the reasons:
            -> my router changed ip address of my Client PC
            -> now that after I have updated the ip address in Disk Manager, my client PC can now access the shared folder again!

  4. Chrome CANNOT see the NFS shared folders, pls. help:

    Recently, my PC crashed, after re-installation of the ZorinOS12 (based on Ubuntu16.04 core and GNOME desktop) and the above NFS automount procedures, the shared folders of Synology DS716+II can be mounted normally.

    I can also access the files in the shared folders normally using the Nautilus file manager, but failed to save downloaded files from Google Chrome browser, i.e. Chrome CANNOT see the shared folders. The same case happens for Firefox too, while Opera works normally!

    I believe that this is due to the updates of ZorinOS12 to its latest stable, so are there anyway to checkout what updates of ZorinOS12 that making Chrome blinded to the shared folders of Synology DS716+II?

    OR
    how to adjust the parameters of NFS to make Chrome and Firefox be able to see the shared folders?
    ==================================
    “192.168.2.100:/volume1/photos /home/user/NASphotos nfs rw,hard,intr,nolock 0 0”

    1. I wonder if this is the result of the new updates due to Spectre and Meltdown. I honestly don’t know, but part of the intention of that update was that it was going to keep certain programs from being able to access the memory of other programs. Perhaps the new kernels have prohibited that.

      Otherwise, I have no idea what would be happening. Honestly, I don’t think I’ve ever tried downloading directly to one of my shared synology drives. I have uploaded from them, but not downloaded from them. And I use Chrome, primarily (Firefox is my backup browser). I can try this when I get home tonight.

  5. I finally find out a less convenient method to save the downloaded files to Shared folders directly!

    Actually they are still there:
    Browse to “home directory” -> and then “NASphotos”

    That’s it!

  6. Dear Ryan,

    My SSD crashed yesterday, after restoring an old image which has not been installed with NFS.

    I repeat the procedures to install NFS, but when I enter the command “sudo mount -a”, the command prompt go to next line and cannot go out.
    -> I wait for a long enough time, and press control-c to exit the command

    after that, although I can see the link of shared folder appeared in the file manager, but when I click on it, the following error displayed:
    ===================================
    Cannot Access “folder01”

    mount: only root can mount 192.168.1.252:/volume1/folder01 on /home/user01/folder01
    ===================================

    I reboot the computer,
    do “sudo apt update” and “sudo apt upgrade”
    and “sudo mount -a” again, but the same phenomenon.

    So do you know what’s wrong?

    Thanks!

    1. I just had a similar issue this past weekend when I was trying to give my wife’s computer access to our Synology NAS. My guess is that the issue is with your settings on your NAS. Has your IP on your computer changed? Did you change the name of your computer or the user on your computer? You should go into the NFS settings in the Synology Control Center and make sure that you are still giving access to the right IP address. That was part of the issue I had this weekend.

      1. Dear Ryan,

        This time a little bit different!
        # I have checked the IP address of the client PC is still 192.168.1.19 and within the range as specified in Synology’s shared folder setup
        # the reason of the error “Cannot Access “folder01”” is that the command “sudo mount -a” cannot be completed!
        -> why the mount command cannot be completed?

        “showmount -e 192.168.1.252”
        will give this output:
        ============================
        Export list for 192.168.1.252:
        /volume1/folder1 192.168.1.18/29
        /volume1/folder2 192.168.1.18/29
        /volume1/folder3 192.168.1.18/29
        /volume1/homes 192.168.1.18/29

        1. You may stump me on this one.

          What’s the line you added to your /etc/fstab file to automount it? Post that. I wonder if something is a little wonky in that.

  7. Thank you so much for this guide!!! I have been trying to get this sorted for several hours using a lot of different methods & this worked perfectly on the first go, much appreciated…..

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.