How to enable NFS on the Synology Server: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Franklin
mNo edit summary
imported>Johayek
mNo edit summary
 
(19 intermediate revisions by 9 users not shown)
Line 6: Line 6:


==Acquire Files==
==Acquire Files==
Please make sure that the Synology product has firmware 2.0.3 - 0518 or above, along with the Telnet service enabled. <br>Both files can be found [http://www.synology.com/enu/support/download.php here].
Please make sure that the Synology product has firmware 2.0.3 - 0518 or above, along with the [[How_to_Enable_Telnet|Telnet service]] or [[How_to_enable_SSH_Service|SSH Service]] enabled. <br>Both files can be found [http://www.synology.com/enu/support/download.php here].




Line 13: Line 13:


===Enabling Service===
===Enabling Service===
With DSM-5.1 it's already there.
<pre>
<pre>
cd /usr/syno/etc/rc.d
cd /usr/syno/etc/rc.sysv
mv S83nfsd.sh.sample S83****.sh
mv S83nfsd.sh.sample S83****.sh
reboot (or /usr/syno/etc/rc.d/S83****.sh start)
reboot (or /usr/syno/etc/rc.d/S83****.sh start)
Line 20: Line 21:
</pre>
</pre>
Note: <nowiki>*</nowiki> needs to be replaced with a number
Note: <nowiki>*</nowiki> needs to be replaced with a number
Note, in newer versions (DSM4), the <code>/usr/syno/etc/rc.d/S83nfsd.sh</code> will already exist. If you try to "<code>start</code>" it, you will get a message telling you that "<code>NFS server is not enabled. Skip...</code>"
You'll need to edit the <code>/etc/synoinfo.conf</code> file and add <code>runnfs="yes"</code>.  Then you'll be able to run <code>/usr/syno/etc/rc.d/S83nfsd.sh start</code>


===Exports file===
===Exports file===
In the exports file, add the following line
In the exports file, add the following line
<pre>
<pre>
/directory/to/export ip.of.NFS.client(ro,root_squash)
/directory/to/export ip.of.NFS.client(ro,root_squash,no_subtree_check)
</pre>
 
Save the export file
 
Check if the file /var/lib/nfs/rmtab does exist, if not, then run the following command
<pre>
touch /var/lib/nfs/rmtab
</pre>
</pre>


After saving the exports file, perform the following
Now perform the following command
<pre>
<pre>
cd /
cd /
/usr/sbin/exportfs -a
/usr/sbin/exportfs -a
</pre>
</pre>
===Testing===
Look at /var/log/messages to check whether the settings are ok with your Synology product




==Instructions for Linux NFS Client==
==Instructions for Linux NFS Client==
On your NFS client, perform the following to mount the NFS Server share
On your NFS client, perform the following to mount the NFS Server share
<pre>
<pre>
Line 41: Line 57:
Note: /volume1/local/share/folder must exist locally, otherwise the mount will fail
Note: /volume1/local/share/folder must exist locally, otherwise the mount will fail


 
<div style="border:1px solid black">
==Windows Services for UNIX 3.5 Fast Setup Guide==
'''Important:''' NFS on the Synology Server is case-'''insensitive''' (as of November 8, 2008; [http://www.synology.com/enu/forum/viewtopic.php?f=3&p=45501 this may change in a later firmware version]). This means if you perform backups by (say) [http://www.samba.org/rsync rsync], and the source directory contains files named "Foo" and "foo", the destination directory will contain only '''one''' of these files, as "Foo" ovewrites "foo" case-insensitively. This behavior happens silently.
Notes:
'''Update: DSM is case-sensitive over NFS since DSM 2.1'''
*Originally written by forum user <b>NetBoot</b>
</div>
*Only Windows Vista Ultimate and Vista Enterprise Supports NFS Out of the Box by Installing Windows Components, Subsystem for UNIX-based Applications.
*For other NT-based Operating Systems, Windows 2000, Windows 2000 Server, Windows XP and Windows 2003 Server install the free Windows Services for UNIX 3.5
 
<br><br>Download and install [http://www.microsoft.com/downloads/details.aspx?FamilyID=896c9688-601b-44f1-81a4-02878ff11778&displaylang=en Windows Services for UNIX Version 3.5]
 
The install defaults should be fine.
<br>Complete the installation and reboot.
 
Telnet to your Syno box. We will need a copy of the passwd and group files located in the /etc
<br>Copy the files to a secure directory using the cp command and change the permissions with chmod.
 
cp /etc/passwd /volume1/secure/passwd
<br>cp /etc/group /volume1/secure/group
<br>chmod 777 /volume1/secure/passwd
<br>chmod 777 /volume1/secure/group
 
Next, copy passwd and group files to C:\SFU\common\ directory
<br>'''Security Note: You may want to consider removing the root accounts from those files'''
 
Next, go into you Programs Menu/Windows Services for Unix and start Services for UNIX Administration
 
Click on Services for UNIX[local]and select the Settings tab.
<br>Computer name should be localhost
 
Next, in the tree tab, click on Client for NFS
<br>The File Permissions and Performance default settings should be fine.
<br>We may play with these settings later.
 
Next, in the tree tab, click on User Name Mapping.
<br>In the Configuration tab, where going to use Password and Group files. So, click on that bullet.
 
Now we're going to select the password and group files that we copied over earlier.
 
Browse for the files and select passwd for Password file path and name.
<br>Browse for the files and select group for Group file path and name.
<br>You should now have C:\SFU\common\passwd and C:\SFU\common\group
<br>Now, click on Apply
 
Now click on the Maps tab.
<br>We're going to do simple maps. So, check the simple maps box.
<br>Since we are using simple maps. The Windows Domain Name should default to your computer name.
<br>Now, click on Apply
 
Next, we're going to setup our permissions. Still in the Maps tab, under Advanced maps click on Show User Maps.
<br>Under Windows domain Name click List Windows Users to fetch the Windows users. Next, click on the List UNIX Users to fetch your UNIX users. We're going to map our user account.
<br>Click your windows user name to the left, and your UNIX user name to the right, and click Add.
<br>You should now have a Mapped user account.
<br>Click the Apply.
 
Now telnet to your Syno box and edit the exports file.
<br>Here's a quick sample to get you going
<pre>
/volume1/nfs/public 192.168.0.0/255.255.255.0(ro,no_root_squash,no_subtree_check)
</pre>
Your subnet may be different then mine, so adjust for yours.
 
Happy NFS serving,
 
Net....
 
<br>P.S. This is just a fastpace setup. Other may find it better to add the UID and GID with the exports.
<br>NFS and Samba: I would strongly suggest users create a directory for NFS and not use your Samba shares for NFS together. I would create a nfs directory off root and setup your NFS shares there and map your exports in there. ie: /volume1/nfs/public I'm sure there would be file lock issues,etc. Maybe someone who is an expert in NFS and Sambe can verify this.
 
 
==Mount a Windows NFS onto the Synology product==
Notes:
*Originally written by forum user <b>NetBoot</b>
 
Here's a quick example.
<br>On you windows system install SUA or SFU.
<br>Make sure you install option Server for PCNFS
<br>I would reboot afterwards.
<br>Now, create a directory off the root directory on C:
 
<pre>
example C:\nfsshare
</pre>
<br>Now, share that directory. Right click on it and select sharing. You should have a new tab called NFS Sharing. Click on the bullet, Share this folder and click Apply.
 
<br>Telnet to your syno box.
<br>Create a directory for you mount point.
<br>I used /volume1/local
<br>So, make a directory local off volume1
 
<pre>
mkdir /volume1/local
</pre>
<br>Now, let's mount our windows share.
<br>run the command
 
<pre>
mount 192.168.0.139:/nfsshare /volume1/local
</pre>
 
<br>the ip address is my windows pc and nfsshare is the directory I shared
<br>/volume1/local is the directory I created on my syno box and is the mount point.
<br>Now, you have a windows nfs share accessable form you syno box.
 
Note:
*The NFS share on windows is default to read only and no root.
*If you want to read/write, go back to your windows nfs share and change your permissions and access. It's really simple
*Files are accessed on the syno box on /volume1/local
*This won't mount again if you reboot your syno box. Ideally, if you have a Windows server running 24/7. I would use that for you windows nfs sharing and auto mount those shares for your syno box.
*This is just a quick and dirty how to.
 
Net....
 


==Notes==
==Notes==
The NFS Service is disabled after every firmware upgrade.
The NFS Service is disabled after every firmware upgrade.
<br>The NFS mount is not shown in the web interface
<br>Files saved on the Synology server are case-insensitive.  
<br>Files saved on the Synology server are case-insensitive.  
<br>Supported versions:
<br>Supported versions:
:NFS 2.0
:NFS 2.0
:NFS 3.0
:NFS 3.0
:NFS 4.0


==External Links==
== MTU Jumbo frames ==
[http://www.faqs.org/docs/securing/chap5sec33.html The /etc/exports file]
For some NFS clients (eg. TViX 6500/7000), errors are reported if jumbo frames are enabled. Mounting the NFS is possible: try disabling the jumbo frames setting in the Synology Disk Station Manager -> system -> network.
 
==Additional Resources==
[http://www.synology.com/enu/forum/viewforum.php?f=41 Synology NFS Forum Room]
<br>[http://www.faqs.org/docs/securing/chap5sec33.html The /etc/exports file]
<br>[http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-nfs-mount.html Mounting NFS File Systems]
<br>[http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-nfs-mount.html Mounting NFS File Systems]
<br>[http://www.microsoft.com/downloads/details.aspx?FamilyID=896c9688-601b-44f1-81a4-02878ff11778&displaylang=en Windows Services for UNIX Version 3.5]
<br>[[Windows Services for UNIX 3.5 Fast Setup Guide]]
<br>[[Export Filesystem as NFS]]
 
[[Category:SynologyWiki]]
[[Category:ToBeExported]]

Latest revision as of 04:49, 29 January 2015

This is a guide on how to enable the NFS capabilities of the Synology product.
This procedure is aimed for users who are experienced with Telnet and the Linux Operating System
Please note that improper manipulation or modification of the Synology server may result in machine malfunction or loss of data.
Please read the General Disclaimer before modifying the Synology product.

Acquire Files[edit]

Please make sure that the Synology product has firmware 2.0.3 - 0518 or above, along with the Telnet service or SSH Service enabled.
Both files can be found here.


Instructions for the NFS Server[edit]

Telnet into the Synology product and perform the following

Enabling Service[edit]

With DSM-5.1 it's already there.

cd /usr/syno/etc/rc.sysv
mv S83nfsd.sh.sample S83****.sh
reboot (or /usr/syno/etc/rc.d/S83****.sh start)
vi /etc/exports 

Note: * needs to be replaced with a number

Note, in newer versions (DSM4), the /usr/syno/etc/rc.d/S83nfsd.sh will already exist. If you try to "start" it, you will get a message telling you that "NFS server is not enabled. Skip..."

You'll need to edit the /etc/synoinfo.conf file and add runnfs="yes". Then you'll be able to run /usr/syno/etc/rc.d/S83nfsd.sh start

Exports file[edit]

In the exports file, add the following line

/directory/to/export ip.of.NFS.client(ro,root_squash,no_subtree_check)

Save the export file

Check if the file /var/lib/nfs/rmtab does exist, if not, then run the following command

touch /var/lib/nfs/rmtab

Now perform the following command

cd /
/usr/sbin/exportfs -a

Testing[edit]

Look at /var/log/messages to check whether the settings are ok with your Synology product


Instructions for Linux NFS Client[edit]

On your NFS client, perform the following to mount the NFS Server share

mount IP.of.NFS.Server:/directory/to/export /volume1/local/share/folder

Note: /volume1/local/share/folder must exist locally, otherwise the mount will fail

Important: NFS on the Synology Server is case-insensitive (as of November 8, 2008; this may change in a later firmware version). This means if you perform backups by (say) rsync, and the source directory contains files named "Foo" and "foo", the destination directory will contain only one of these files, as "Foo" ovewrites "foo" case-insensitively. This behavior happens silently. Update: DSM is case-sensitive over NFS since DSM 2.1

Notes[edit]

The NFS Service is disabled after every firmware upgrade.
The NFS mount is not shown in the web interface
Files saved on the Synology server are case-insensitive.
Supported versions:

NFS 2.0
NFS 3.0
NFS 4.0

MTU Jumbo frames[edit]

For some NFS clients (eg. TViX 6500/7000), errors are reported if jumbo frames are enabled. Mounting the NFS is possible: try disabling the jumbo frames setting in the Synology Disk Station Manager -> system -> network.

Additional Resources[edit]

Synology NFS Forum Room
The /etc/exports file
Mounting NFS File Systems
Windows Services for UNIX 3.5 Fast Setup Guide
Export Filesystem as NFS