I originally purchased my Synology NAS because of all of the packages that it offers and the fact that it was supposed to give me one less thing to manage. After a few failed attempts at getting OpenVPN to work and some Plex issues I decided that I needed to have something a little less opaque that I could install different packages on. I wanted something small, low power, and solid state so I decided to use the BeagleBone Black.
I tried using both CIFS/Samba and sshfs to mount the Synology’s filesystem but both of them had extremely strange issues with the applications I planned on using. I wouldn’t recommend either of them for production work involving Linux and NAS. Often it would tell me that files didn’t exist even though I could clearly see they were there. After moving to NFS none of this happened anymore.
NOTE: Security here is all done by IP address so this is not suitable for a sensitive environment!
Here are the steps I went through to connect my first enable and configure NFS on my Synoloy NAS:
- Make sure your BeagleBone Black has a static IP and that you know what it is
- Log into the Synology web GUI as an admin
- Click “Control Panel”
- Click “Win/Mac/NFS”
- Click “NFS Service”
- Make sure that “Enable NFS” and “Enable NFSv4 support” are checked
- Click the link that says “Shared Folder”
- Find and select the directory you want to share. In my case it was my user account’s home directory so I selected “homes”.
- Click the “Privileges” drop down
- Select “NFS Privileges”
- Click “Create”
- Enter your BeagleBone Black’s IP address into the “Hostname or IP” field
- Make sure that the “Privilege” field is set to “Read/Write”
- Make sure that the “Root squash” field is set to “No mapping”
- Make sure that “Enable asynchronous” is checked
- Make sure that “Allow connections from non-privileged ports (ports higher than 1024” is NOT checked
- Click “OK” in the “Create an NFS rule” popup
- Take note of the “Mount path” field in the “Edit NFS privileges of homes” window, you’ll need this later
- Click “OK” in the “Edit NFS privileges of homes” window
- Log out of the Synology web GUI
Now you have your Synology all set up to accept NFS connections from your BeagleBone Black. Here are the steps to do that:
- Connect to your BeagleBone Black via SSH as a user that can run sudo
- Install the NFS utilities and client by running “sudo apt-get install nfs-common”
- Go to your home directory
- Create a directory for your Synology mount point. I chose “synology”.
- Mount your directory using the “Mount path” from above along with any additional paths to get you to the desired directory you want. My mount path was “/volume1/homes” but I wanted “/volume1/homes/tim” for my actual home directory. The command I used was “sudo mount -t nfs synology:/volume1/homes/tim /home/tim/synology/”
- Test out your newly mounted Synology NAS
You can now add this to your /etc/fstab file if you’d like but I prefer to keep it in a script. I have a script called mount-nfs.sh in my home directory that I run when necessary since I’m still testing out NFSv4. Once I get it stable I’ll make sure that I get it to mount automatically the proper way and update this post.
If you receive an error message that says “mount.nfs: access denied by server while mounting synology” you probably have the wrong IP for your BeagleBone Black in the Synology configuration.
If it appears to mount the volume but no files show up try unmounting it and re-mounting it. If you unmount it successfully and when re-mounting it again it complains that the device is busy it is possible that your BeagleBone Black’s IP address changed. This happened on my test machine when its IP went from 192.168.1.109 to 192.168.1.110. It didn’t give me the access denied error message but instead exhibited this weird behavior. If this is the case make sure you have your IP assigned statically, reboot the BeagleBone Black, verify the static IP in the Synology configuration again, and then try re-mounting the path. After that mine started working again.
Good luck! Post any success stories or issues in the comments. I’ll do my best to help out if possible.