NFS

From OLPC
Jump to: navigation, search

The Network File System lets you use files on another machine as if they were actually on your XO laptop.

Last tested on 13.2.0.

Installation

Installation consists of two steps:

  • adding a package to your XO laptop, and
  • adding an authorization line to the NFS server.

The procedures below assume:

  • your XO laptop's IP Address is 192.168.1.250;
  • the IP Address of the NFS server is 192.168.1.2;
  • you want /home/johndoe on the NFS server to be visible as /mnt on your XO laptop.

To find your XO's actual IP Address, do this in Terminal ActivityActivity-terminal.svg:

sudo ifconfig

Look at the lines that start with inet addr:. One will show 127.0.0.1; ignore this one. Likely ignore the one for the mesh network on XO-1, named msh0. The one that's left will be the one you want to use.

Installing NFS capability on your XO

On your XO laptop, in Terminal ActivityActivity-terminal.svg, install the nfs-utils package:

sudo yum install -y nfs-utils

This will cause yum to install the nfs-utils package and several other packages it requires.

A reboot is needed after the install. Grumbel had trouble with rpcbind and thus rcp.statd not starting up and NFS mounts thus fail with: "mount.nfs: rpc.statd is not running but is required for remote locking". Doing a:
service rpcbind restart
service nfslock restart
service nfs restart
might also be enough to fix this.

Authorizing your XO for NFS

On your NFS server, add a line to the /etc/exports file and reload nfs:

su -
echo "/home/johndoe 192.168.1.250(ro,no_root_squash)" >> /etc/exports
service nfs reload
exit

The items in parentheses are options. The value ro means read-only; your server will not allow the XO to modify files in the /home/johndoe directory. The value no_root_squash means your server will skip numeric-userid checking. For a full explanation, do man exports on your NFS server.

Mounting

You use the mount command as usual to mount files that reside physically on an NFS server, mount device mountpoint, but the device parameter has a special form: host:directory, that is, the NFS server's hostname or IP Address, a colon, and the directory to be mounted:

mount nfs-server.mynetwork.com:directory mount-point

Mounting /home/johndoe on your XO

On your XO laptop, in Terminal ActivityActivity-terminal.svg, mount the remote directory:

sudo mount 192.168.1.2:/home/johndoe /mnt
exit

Using NFS mounts

Refer to files and directories of a NFS-mounted filesystem by mount-point, just as if they resided on your XO laptop.

Using NFS-mounted files on your XO

Suppose that /home/johndoe/public_html/index.html is the index to John Doe's webpage. In the Browse ActivityActivity-web.svg, give this as the location you wish to browse to:

file:///mnt/public_html/index.html

See Also