imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

How to Run NFS Server on Raspberry Pi

Tue Aug 14, 2012 7:30 am

Hi All,
I'm a newbie and couldn't find any information on this.
I was to setup a NFS Server running on my raspberry pi. Can anyone please tell me how to setup that? Also, do I need to overclock my Raspberry pi for it to work properly? Thanks :D

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Tue Aug 14, 2012 8:46 am

Pretty similar to the way it is done in this guide
http://www.cyberciti.biz/faq/how-to-ubu ... ion-howto/
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

Re: How to Run NFS Server on Raspberry Pi

Tue Aug 14, 2012 7:58 pm

Awesome thanks, will check it and try it out when i get home tonight =)
SirLagz wrote:Pretty similar to the way it is done in this guide
http://www.cyberciti.biz/faq/how-to-ubu ... ion-howto/

spitecho
Posts: 24
Joined: Tue Jul 10, 2012 12:03 am
Location: internet

Re: How to Run NFS Server on Raspberry Pi

Tue Aug 14, 2012 11:57 pm

No need to overclock for NFS to work, but a few things to keep in mind when you use that tutorial:
  • 1. Raspbian has no portmap in the repos, so don't worry when it doesn't install. Skip any steps involving it.
    2. When you add the mount to the remote machine's /etc/fstab, the filesystem should be "nfs" instead of "nfs4" and you might have to add "nolock" to the mount options. My fstab line looks like this:

    Code: Select all

    192.168.1.8:/mnt/external    /mnt/external   nfs     _netdev,auto,nolock     0       0
    3. Copying to the NFS server from a remote machine seems to hang the transfer--though that could be related to my USB drive being the NFS export. If you have this problem, using scp is a good way around it. It's slower, but less likely to choke your Pi's connection.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 12:47 am

sorry, only skimmed over that tutorial.
You want to use rpcbind rather than portmap.

When you apt-get the files though, it'll get everything for you anyway
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 3:50 am

ok so first of all, i'm using the raspbian "wheezy" distribution. You guys are right, this distribution doesn't support portmap and already comes with rpcbind.

i installed the nfs server by running the following command:

sudo apt-get install nfs-kernel-server nfs-common

however, when I start my nfs server, i get the following error:

Not starting NFS kernel daemon: no support in current kernel. ... (warning).

I thought that raspbian supported NFS by default. Any ideas how to get a kernel that supports NFS?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 3:58 am

rpi-update to update the kernel and see how you go ?
Which version of the raspbian wheezy distribution are you using ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 4:09 am

SirLagz wrote:rpi-update to update the kernel and see how you go ?
Which version of the raspbian wheezy distribution are you using ?
I'm using the latest distro available from http://www.raspberrypi.org/downloads, which seems to be the Jul 15th build (2012-07-15-wheezy-raspbian)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 4:37 am

check out the bootc kernel and see if you can use that one
I'm not too familiar with the new kernels at the moment.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

ers
Posts: 11
Joined: Mon Jun 11, 2012 9:45 pm

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 5:25 am

run rpi-update,

I have this version, and it supports nfs-kernel.

#242 PREEMPT Wed Aug 1 19:47:22 BST 2012

however, i am trying to run it as nfs3+ higher since files over 2gb seems to have wrong file sizes.issue is related to nfs , and I am not sure how can I force nfs to use a higher version in the /etc/exports file.

imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 7:50 am

ers wrote:run rpi-update,

I have this version, and it supports nfs-kernel.

#242 PREEMPT Wed Aug 1 19:47:22 BST 2012

however, i am trying to run it as nfs3+ higher since files over 2gb seems to have wrong file sizes.issue is related to nfs , and I am not sure how can I force nfs to use a higher version in the /etc/exports file.
Thanks just did that, nfs server is up and running even though I wasn't able to install portmapper (ignored it as suggested above). I'm now having issues having XBMC on apple TV2 access my NFS directory. I'm using the following /etc/export

/home/nfs *(ro,all_squash,insecure)

Would anyone know how I can make sure that my NFS connectivity works?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 15, 2012 1:40 pm

did you run exportfs -r after adding that line ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

imran
Posts: 6
Joined: Tue Aug 14, 2012 7:27 am

Re: How to Run NFS Server on Raspberry Pi

Thu Aug 16, 2012 6:47 am

SirLagz wrote:did you run exportfs -r after adding that line ?
I tried that but still no go, AppleTV would just not recognize the NFS server running on my raspberry pi. I then decided to try SMB instead and it worked immediately. So for now I'm going to stick with SMB until I can resolve the NFS server issues. Thanks everyone, this forum is a wonderful resource for newbies like me :)

pythoncoder
Posts: 2
Joined: Sun Aug 19, 2012 2:23 pm

Re: How to Run NFS Server on Raspberry Pi

Sun Aug 19, 2012 2:35 pm

I've tried XBMC on a Pi and had no success connecting to an NFS share. It works fine using Samba. Note that these shares are on a commercial NAS box and the NFS share is in daily use: it is entirely reliable. I tried to access it by using XBMC directly to access the share. When this failed I tried mounting the share and accessing it as part of the local filesystem. In both cases XBMC tended to hang.

So perhaps XBMC is having problems rather than your server.

I have also set up a Pi as an NFS server and have experienced the same issues as you. Firstly it only supports the version 2 protocol with a 2GB file size limit. And secondly it's unstable if you copy lmultiple gigabytes of data across to it. Hopefully these issues will be resolved in a future upgrade.

Regards, Pete

pythoncoder
Posts: 2
Joined: Sun Aug 19, 2012 2:23 pm

Re: How to Run NFS Server on Raspberry Pi

Tue Sep 04, 2012 5:00 pm

I now have an NFSV4 server running reliably on the Pi. I rebuilt the kernel using the instructions at
http://elinux.org/RPi_Kernel_Compilatio ... compiler_2
and copying the new kernel image in the raspberrypi directory tree at linux/arch/arm/boot/Image to /boot/kernel.img

After a reboot I could mount the Pi NFS shares, using the fstab line below to force a user mount command to use the V4 protocol:
pi01:/mnt/usb01 /mnt/pidisk nfs4 user,noauto 0 0
Note pi01 maps to the IP address of the pi on my system and /mnt/usb01 is the NFS share

To date it seems reliable, it can handle files much bigger than 2GB and also offers decent performance (7MB/s write, 5.7MB/s read). This is pretty much the most that can be expected of the Pi's 100Mbps network connection.

Regards, Pete

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: How to Run NFS Server on Raspberry Pi

Tue Sep 04, 2012 5:14 pm

pythoncoder wrote:I now have an NFSV4 server running reliably on the Pi. I rebuilt the kernel using the instructions at
Latest kernel available through rpi-update has NFSV4 support.

tbar
Posts: 98
Joined: Thu Nov 24, 2011 6:10 am

Re: How to Run NFS Server on Raspberry Pi

Sat Oct 27, 2012 7:59 am

dom wrote:
pythoncoder wrote:I now have an NFSV4 server running reliably on the Pi. I rebuilt the kernel using the instructions at
Latest kernel available through rpi-update has NFSV4 support.
When is this kernel expected to be available in stable? As I understand it rpi-update is bleeding-edge and apt-get update && apt-get upgrade is stable. I don't want to run bleeding-edge but running stable gives me the following kernel which doesn't seem to contain NFSV4 support:

# cat /proc/version
Linux version 3.1.9+ (dc4@dc4-arm-01) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #278 PREEMPT Wed Aug 15 20:59:07 BST 2012

skiwithpete
Posts: 9
Joined: Sun Sep 25, 2011 8:09 am

Re: How to Run NFS Server on Raspberry Pi

Thu Nov 22, 2012 9:28 am

This is the command I couldn't find in this list:
sudo /etc/init.d/rpcbind start

That should help the portmap errors. Someone should create a step by step wiki for this though as this took many hours of searching

michaelfackrell
Posts: 10
Joined: Tue Jul 30, 2013 10:21 pm

Re: How to Run NFS Server on Raspberry Pi

Thu Aug 01, 2013 4:08 am

so I tried to installed the nfs server by running the following command:

sudo apt-get install nfs-kernel-server nfs-common

here is what i got in the end:
update-rc.d: error: insserv rejected the script header
dpkg: error processing nfs-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nfs-kernel-server:
nfs-kernel-server depends on nfs-common (= 1:1.2.6-4); however:
Package nfs-common is not configured yet.

dpkg: error processing nfs-kernel-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
nfs-common
nfs-kernel-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


any suggestions?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Thu Aug 01, 2013 5:15 am

run apt-get install nfs-common by itself
and then run apt-get install nfs-kernel-server
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

michaelfackrell
Posts: 10
Joined: Tue Jul 30, 2013 10:21 pm

Re: How to Run NFS Server on Raspberry Pi

Thu Aug 01, 2013 3:56 pm

When I run them separately I get this error:

insserv: Service rpcbind has to be enabled to start service nfs-common

What is rcpbind, and how do I enable it?

Sorry if this is a dumb question, I'm new to programming.

Edit: I think I figured it out...looked at another post and tried this:

sudo update-rc.d rpcbind defaults
(Reboot)
sudo apt-get install nfs-kernel-server
Seems to have worked any way to check?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Fri Aug 02, 2013 5:42 am

michaelfackrell wrote:When I run them separately I get this error:

insserv: Service rpcbind has to be enabled to start service nfs-common

What is rcpbind, and how do I enable it?

Sorry if this is a dumb question, I'm new to programming.

Edit: I think I figured it out...looked at another post and tried this:

sudo update-rc.d rpcbind defaults
(Reboot)
sudo apt-get install nfs-kernel-server
Seems to have worked any way to check?
Run this

Code: Select all

/etc/init.d/nfs-kernel-server status
and it will tell you if nfs daemon is running or not
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: How to Run NFS Server on Raspberry Pi

Sun Aug 04, 2013 5:07 am

pythoncoder wrote:To date it seems reliable, it can handle files much bigger than 2GB and also offers decent performance (7MB/s write, 5.7MB/s read). This is pretty much the most that can be expected of the Pi's 100Mbps network connection.
How do you (or others with decent speed) have your drive setup? What filesystem? I've tried NTFS and EXT4 on an external USB drive but I/O seems pretty slow. I guess I should try an older, simpler filesystem?

michaelfackrell
Posts: 10
Joined: Tue Jul 30, 2013 10:21 pm

Re: How to Run NFS Server on Raspberry Pi

Tue Aug 06, 2013 2:18 pm

SirLagz wrote:
michaelfackrell wrote:When I run them separately I get this error:

insserv: Service rpcbind has to be enabled to start service nfs-common

What is rcpbind, and how do I enable it?

Sorry if this is a dumb question, I'm new to programming.

Edit: I think I figured it out...looked at another post and tried this:

sudo update-rc.d rpcbind defaults
(Reboot)
sudo apt-get install nfs-kernel-server
Seems to have worked any way to check?
Run this

Code: Select all

/etc/init.d/nfs-kernel-server status
and it will tell you if nfs daemon is running or not

so i ran the code and it came back as not running...any idea why?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How to Run NFS Server on Raspberry Pi

Wed Aug 07, 2013 5:14 am

No idea.
But if you run

Code: Select all

/etc/init.d/nfs-kernel-server start
and paste any errors if there are any, then I'll have some idea :)
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 22 guests