In a previous post, I wrote about the steps I followed when enabling SSH, SCP/SFTP and configuring a static IP address on my Synology NAS.
In this post, I'll walk you through the steps I followed when enabling NFS on my Synology NAS.
Enabling Services
Login to the Synology DiskStation Manager (DSM) from your web browser (you can find the IP address, for example, 192.168.1.100 on your router's status page):
http://<IP-ADDRESS>:5000/
And, navigate to the Control Panel:
Enable NFS
Click on 'File Services' and on the 'Win/Mac/NFS' tab check the box next to Enable NFS
and check the box next to Enable NFSv4 support
:
Click the Apply button to save the settings.
Assign NFS Permissions to Shared Folders
Before accessing any shared folders with your NFS client, you must first configure the NFS permissions of the shared folder you wish to access. In the Control Panel click on 'Shared Folder' then select the shared folder you want to access and click the Edit button:
On the 'NFS Permissions' tab click the Create button:
Edit the NFS rules to suit your configuration:
I want all hosts on my home network to be able to access the shared folder so I used a wildcard ('*') for the 'Hostname or IP' field. Click the OK button to save your settings:
The mount path (i.e., /volume1/documents) is displayed on the bottom left of the screen.
Note: Don't forget to grant your users permissions to the shared folder:
Mounting Shared Folders via NFS
I'm using Elementary OS Freya (running in VirtualBox on my MacBook Pro) so I needed to install the required packages for the NFSv4 client:
sudo apt install nfs-common
We can use the showmount
command to query the mount daemon (NFS Server):
showmount -e nas-1
You should see output like:
Export list for nas-1:
/volume1/documents *
Note: nas-1 (the static IP address: 192.168.1.100) is configured in my /etc/hosts
file.
Now we can mount the shared folder:
sudo mount nas-1:/volume1/documents /mnt
We can use the df
(disk free) command to confirm that we have successfully mounted the shared folder:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 61796348 24567160 34067076 42% /
...
nas-1:/volume1/documents 5621463168 307087744 5314375424 6% /mnt
Or the Elementary OS File Manager:
References:
- Synology Docs: How to access files on your Synology NAS within the local network NFS
- Ubuntu Docs: How to setup NFS