Skip to content

Network File System (NFS)

Syed Sayem edited this page May 16, 2019 · 1 revision

Table of contents

 

Before You Start

Enable NFS on Your Synology NAS

Login to the Synology DiskStation Manager (DSM) from your web browser (you can find the IP address) from your router home page, most routers, depending on brand, use either 192.168.1.1 or 192.168.0.1

http://<IP-ADDRESS>:5000/
  • Open your Synology Control Panel from the Desktop.
  • Click the File Services option in the File Sharing tab.
  • Next, check the Enable NFS box under the NFS Service tab.
  • Confirm your choice by clicking the Apply button.

 

Assign NFS Permissions to Shared Folders

After you’ve enabled NFS on your Synology NAS, you will also need assign NFS Permissions to Shared Folders. To do that, follow these steps:

  • Open your Synology Control Panel from the Desktop.
  • Select the Shared Folder tab from the menu on the left.
  • Select the folder you want to share, for examples: video.
  • Then, click the Edit button.
  • Click the Permissions tab.
  • Check the Read/Write box for admin.
  • Next, go to NFS Permissions tab
    • Click Create or Edit
    • Set Hostname or IP* to your PC IP Address
    • Set Privilege to Read/Write
    • Set Squash to Map all users to admin
    • Set Security to sys
    • Check Enable asynchronous box
    • Check Allow connections from non-privileged ports box
    • Check Allow users to access mounted subfolders box
  • Click OK
  • Click OK once more to confirm the rule creation.

 

Mount Shared Folders via NFS

Once you have completed the steps above, you can mount the shared folder with your NFS client. To do that, follow these steps:

Install NFS utility

$ pacman -S nfs-utils 

Start server

$ sudo systemctl enable rpcbind.service
$ sudo systemctl start rpcbind.service
$ sudo systemctl enable nfs-client.target
$ sudo systemctl start nfs-client.target
$ sudo systemctl start remote-fs.target

Manual mounting Show the server's exported file systems:

$ showmount -e DiskStation 

 

Create a directory where you want to mount DiskStation:

$ mkdir /home/sayem/DiskStation

 

Then mount omitting the server's NFS export root:

# sudo mount -t nfs DiskStation:/volume1/video /home/sayem/DiskStation

Make sure DiskStation folder exist in /sayem/home/DiskStation

 

Configure Automount

Install the autofs packages

You can install the autofs with this command:

sudo pacman -Syu autofs

You can verify that the autofs files have been placed in the etc directory:

cd /etc; ll auto*
total 40K
-rw-r--r-- 1 root root  15K Aug  2  2018 autofs.conf
-rw------- 1 root root  232 Aug  2  2018 autofs_ldap_auth.conf
-rw-r--r-- 1 root root  816 Aug  2  2018 auto.master
drwxr-xr-x 2 root root 4.0K Aug  2  2018 auto.master.d
-rw-r--r-- 1 root root  524 Aug  2  2018 auto.misc
-rwxr-xr-x 1 root root  902 Aug  2  2018 auto.net
-rwxr-xr-x 1 root root 2.2K Aug  2  2018 auto.smb

 

Configure autofs

Configure the auto.master

Edit the /etc/autofs/auto.master file and append the following:

/home/sayem/DiskStation /etc/autofs/auto.home --time-out=5 --ghost

Next, create the auto.home file in /etc/autofs directory:

sudo /etc/autofs/auto.home

Add the following to the /etc/autofs/auto.home configuration file:

video  -fstype=nfs,rw,soft,retry=0   DiskStation:/volume1/video/

Start the autofs service:

sudo systemctl enable autofs.service

And then enable so that it will run at boot:

sudo systemctl start autofs.service

Done. Now you should be able to access your Synology file at ~/DiskStation directory.

 

Clone this wiki locally