Mounting an NFS share (DNS-320) in Ubuntu

I wanted to stream videos from my NAS (a D-Link DNS-320) on my media centre (running Mythbuntu). Here’s how to use NFS.

First, set up an NFS share on the DNS-320, using the GUI. The only ‘gotcha’ is ensuring to specify which hosts can access the share using the ‘Host’ field in settings page 2-1-2. You can just use the ‘*’ wild card if you’re feeling lazy. Leaving this blank will block all hosts!

On the client, install nfs-common:

$ sudo apt-get install nfs-common

And create a folder to mount to:

$ sudo mkdir /media/nas

Now add the following line to /etc/fstab: /media/nas nfs rw,hard,intr 0 0 is the (static) IP of the NAS.  You will either need to set up your NAS to have a static IP, or use the host name of the NAS here instead.

‘/mnt/HD/HD_a2/Data’ is the full path of the ‘Data’ folder, on ‘Volume 2′ (HDD 2) of the NAS.  This isn’t specified in the manual or help, which is really the reason of this post!  This will be different if you have enabled RAID.

The rest is reasonably self explanatory.

Finally, test it:

$ sudo mount -a
$ ls /media/nas

You should see your files!