This week I've posted about my new Raspberry Pi which is running XBMC. All my media is stored on my Synology Diskstation and accessible over the network using the SMB protocol. The disadvantage of SMB is that it's very CPU intensive, and because the Pi has only a 700 MHz CPU core you may experience some hick-ups during video playback. To solve this we can use NFS to share the media to XBMC. The NFS protocol has less overhead compared with SMB and therefor uses about 20% less CPU resources.
So in this post I'll explain how to enable NFS on the Synology DS and connect these shares to XBMC.
Please note that in this guide there's no access control on the NFS exports, so within the local network every NFS capable device can access the shares with read/write permissions. In my case (and I think for many users) this isn't a problem.
So let's get started, first we need to logon to the Synology Disk Manager (http://SYNOLOGY_IP:5000) and open the control panel. In the control panel we need to enable SSH access to the DS ('Control Panel' -> 'Terminal' -> 'Enable SSH service');
Now we have to enable NFS from the control panel ('Control Panel' -> 'Win/MAC/NFS' -> 'NFS Services' -> 'Enable NFS');
Now the NFS service is enable we can share our media folders from the 'Shared Folder' section within the control panel;
Select the folder you want to export using NFS and click 'Privileges', 'NFS Privileges';
Click in the newly opened window on 'Create' to create a new export;
In this screen we need to grand a hostname or IP-address to access the NFS export, in my case I allow all devices in my network so I placed a asterisk (*) in the hostname field. I set the privilege to 'Read/Write' because XBMC needs to be able to write nfo files. After you set the parameters just click 'OK' to add the export.
As you can see the export is created on the volume, repeat this task for every folder you want to export with NFS.
Now we've made the exports we need to customize them a little bit (by default the NFS export option 'insecure_locks' is enabled, we need to disable this option and enable the 'insecure' option so NFS will listen on insecure ports). To do this we need to logon to the Diskstation via SSH (you can use the freeware Windows application Putty to do so, http://www.putty.nl).
Connect to the IP of your DS and use the username 'root' with the password of the admin users you're used to use in the webadmin.
Once you're logged in execute the command 'cat /etc/exports', this command will show the NFS exports we created earlier;
Type 'vi /etc/exports' to edit the /etc/exports file, and change all the "insecure_locks" entries to simply read "insecure". If you don't know vi: press the INS[SERT] key, use arrows to go to the line to edit, and delete/edit the line. Then press the ESC key, and type 😡 to 'Save & Exit'. When we now run 'cat /etc/exports' we'll see the modified settings;
To make the settings active you must run the command 'exportfs -ra';
Now the NFS configuration is complete, you can connect to the NFS exports from XBMC. Please not that the library will be altered since the paths to the media has changed, if you use a shared (MySQL) library you have to make sure to place the sources.xml on all your XBMC devices.