MBWE and NFS

For quite some time I’ve been trying to set up NFS an my MyBook World Edition (white light) to be able to mount the shared directories directly from Ubuntu.

Here is what I did:

  1. Enable NFS from the web front-end.
  2. On MBWE, adjust /etc/exports:
  3. /nfs/Public *(rw,all_squash,sync,insecure,anonuid=65534,anongid=1000)

  4. On Ubuntu, adjust /etc/fstab (my MBWE’s hostname is mybook):
  5. mybook:/nfs/Public /media/mybook nfs rw,user,nosuid,nodev 0 0

  6. On MBWE type: exportfs -ra

This seemed to have worked for a while but I noticed a few things:

  1. After every reboot, the statement in /etc/exports was back to ro instead of rw (which meant that the directory could only be mounted read-only).
  2. When trying to mount the directory, I got the following error message (this didn’t seem to have occurred at the beginning of my tests?):

mount.nfs: requested NFS version or transport protocol is not supported

As I couldn’t figure out how to tell MBWE not to overwrite /etc/exports during reboot, I added a start-up command to overwrite it with my version of the file. To do this, I added a file called S99nfsd_config to /etc/init.d/ which contains the following lines:

#!/bin/sh
cp /etc/exports.working /etc/exports
/etc/init.d/S80nfsd restart

The file /etc/exports.working contains my changes (see above).

The second issue is due to the way the portmapper is set up. By default, /etc/hosts.deny contains the following line:
portmap:ALL
This means that no RPC programs can be seen from the client (try rpcinfo -p mybook from Ubuntu). I added the following line to /etc/hosts.allow:
portmap: 192.168.1.0/255.255.255.0
Note: My MBWE and the Ubuntu client both have an IP in the range 192.168.1.1-255.

I then had to restart nfsd. Btw, the file /etc/hosts.allow doesn’t seem to be overwritten during the boot process.

PS I might have left out some important setup steps above as I’m writing these notes from memory.

2 thoughts on “MBWE and NFS

  1. Great post! one question though. How do you make the S99nfsd_config so that it runs at boot. I think I need to run some command to make it “runnable”?

    🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.