23/06/2009

Enabling NFS on Synology Diskstation 209 (version 2.1) and with ubuntu 9.04 client

I have been looking out for a NAS device for a few months that needed to match a few core conditions:

1. has lots of disk space (over 1 GB)
2. be able to host squeezecenter for my squeezebox duet
3. easy access to shares on the NAS from linux and windows
4. be able to make backups of windows and linux powered computers in network
5. low power consumption

After reading a lot of reviews and comparison charts I finally decided on the Synology Diskstation 207+, but since that was being replaced by a newer version, I bought the successor: Synology Diskstation 209. I stuffed it with 2 WD Caviar Green 1 TB eco friendly hard disks which have me a total of 2 TB. I've decided to choose RAID-0 for now and maybe change it later to a RAID-1 configuration.

• condition 1: check!

Next up was installing squeezecenter, which was pretty easy to do, because you can download the 'value application' right from the synology website. It worked like a charm.

• condition 2: check!

Now the easy access to the shares defined on the NAS for windows and linux clients. We have a couple of possibilities to do this:

• FTP
• Windows File Service (credentials by workgroup or domain)
• AppleTalk (that's for you, proprietary appleboy)
• NFS (Network File System)

The easiest way and the one i tried first was accessing the windows file share with the 'connect to server' application picking 'Windows share' as a service type. That worked so I then also tried to add the mount point to /etc/fstab which also worked.



But there was something wrong with the permissions and I couldn't get it right. Even if I entered the admin credentials I stumbled across 'permission denied' exceptions. I've tried various things to solve it, but no alas. This wasn't running as stable as it should be.
Appletalk was ruled out and after some searching after mounting FTP shares (which isn't easily possible) there was only 1 possibility left.

NFS allows a user on a client computer to access files over a network in a manner similar to how local storage is accessed. This isn't on by default in ubuntu, so you won't find in the 'connect to server' application. Because I have control over the server and the client I need to have the correct settings on both. Let's start with the client.

NFS Client settings

This blogpost says it all.
You need 2 services running: portmap and nfs-common. Only portmap was running on my machine so I also installed the other service.
After trying to mount the share from the command line

sudo mount 192.168.2.4:/volume1/share /media/share

where 192.168.2.4 is the ip address of the NAS device, /volume1/share is the share on the NAS, and /media/share is the local folder that I created manually (important, you need to do this before mounting).
I got the following error: mount.nfs: access denied by server while mounting.
So this made me conclude that my client settings are okay.

Server NFS settings

First enable NFS on the diskstation.



If you have a share already you can list them from the client this way:

showmount -e 192.168.2.4

Now for the real action: this wasn't as easy as the client settings. First of all the server in this situation (the Synology DS209) has no GUI like the client. Therefore I had to enable Terminal Service options in the disk station manager.



This wikipage has the different steps to setup NFS on a synology server. For the terminal server I used telnet from the command line

telnet 192.168.2.4

Important here is that you need to login with root and not with admin. Admin doesn't have all the permissions. The password for root is the same as your admin password.
Following the steps on the wiki page:

cd /usr/syno/etc/rc.d
mv S83nfsd.sh 5830001.sh (there is no S83nfsd.sh.sample and I replaced the 4 * with a number. I have no clue why this is though)
• I did a reboot
vi /etc/exports

And then you're in vi. As a first time user I had to look up some commands and I found those I needed here.

I edited the exports file this way:

/volume1/Share 192.168.2.2(rw,no_root_squash)

where 192.168.2.2 is the ip address of the client. I first tried it with an IP range, but that didn't work.

I 'touched' the /var/lib/nfs/rmtab file, because it wasn't there, with

touch /var/lib/nfs/rmtab

and

/usr/sbin/exportfs -a

After that I could connect from the client to the server. I added following line to /etc/fstab to boot it automagically:
192.168.2.4:/volume1/Share /media/share nfs rsize=32768,wsize=32768 0 0

What's pretty cool is that I'm connected to the lan wireless and that the share only mounts when it can find it. Nice!

• condition 3: check!

I still have to figure out the best backup procedure for the windows and linux machines and will have to measure energy consumption.
But that will be for later.

3 comments:

  1. Hey,

    I would be VERY interested to know the energy consumption with these specific hard drives. I'm looking into buying the DS209 and I'm pretty sure the specs (~25W) are a bit exaggerated. Or rather I hope they are.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete