How to enable NFS on the Synology Server

From wiki
Revision as of 04:03, 30 November 2007 by imported>NetBoot
Jump to navigation Jump to search

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

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


Instructions for the NFS Server

Telnet into the Synology product and perform the following

Enabling Service

cd /usr/syno/etc/rc.d
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

Exports file

In the exports file, add the following line

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

After saving the exports file, perform the following

cd /
/usr/sbin/exportfs -a


Instructions for Linux NFS Client

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


Windows Services for UNIX 3.5 Fast Setup Guide

Notes:

  • Originally written by forum user NetBoot
  • Only Windows Vista Ultimate, Vista Enterprise and Windows Server 2003 R2, Supports NFS Out of the Box by Selecting Windows Feature on, 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



Download and install Windows Services for UNIX Version 3.5

The install defaults should be fine.
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
Copy the files to a secure directory using the cp command and change the permissions with chmod.

cp /etc/passwd /volume1/secure/passwd
cp /etc/group /volume1/secure/group
chmod 777 /volume1/secure/passwd
chmod 777 /volume1/secure/group

Next, copy passwd and group files to C:\SFU\common\ directory
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.
Computer name should be localhost

Next, in the tree tab, click on Client for NFS
The File Permissions and Performance default settings should be fine.
We may play with these settings later.

Next, in the tree tab, click on User Name Mapping.
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.
Browse for the files and select group for Group file path and name.
You should now have C:\SFU\common\passwd and C:\SFU\common\group
Now, click on Apply

Now click on the Maps tab.
We're going to do simple maps. So, check the simple maps box.
Since we are using simple maps. The Windows Domain Name should default to your computer name.
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.
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.
Click your windows user name to the left, and your UNIX user name to the right, and click Add.
You should now have a Mapped user account.
Click the Apply.

Now telnet to your Syno box and edit the exports file.
Here's a quick sample to get you going

/volume1/nfs/public 192.168.0.0/255.255.255.0(ro,no_root_squash,no_subtree_check)

Your subnet may be different then mine, so adjust for yours.

Happy NFS serving,

Net....


P.S. This is just a fastpace setup. Other may find it better to add the UID and GID with the exports.
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 NetBoot

Here's a quick example.
On you windows system install SUA or SFU.
Make sure you install option Server for PCNFS
I would reboot afterwards.
Now, create a directory off the root directory on C:

example C:\nfsshare


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.


Telnet to your syno box.
Create a directory for you mount point.
I used /volume1/local
So, make a directory local off volume1

mkdir /volume1/local


Now, let's mount our windows share.
run the command

mount 192.168.0.139:/nfsshare /volume1/local


the ip address is my windows pc and nfsshare is the directory I shared
/volume1/local is the directory I created on my syno box and is the mount point.
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

The NFS Service is disabled after every firmware upgrade.
Files saved on the Synology server are case-insensitive.
Supported versions:

NFS 2.0
NFS 3.0

External Links

Synology NFS Forum Room
The /etc/exports file
Mounting NFS File Systems
Windows Services for UNIX Version 3.5