NFS: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Undo revision 244145 by 83.145.241.84 (Talk))
No edit summary
Line 1: Line 1:
The Network File System lets you use files on another machine as if they were actually on your XO-1 laptop.
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 ==


Installation consists of two steps:
Installation consists of two steps:
* adding a package to your XO-1 laptop, and
* adding a package to your XO laptop, and
* adding an authorization line to the NFS server
* adding an authorization line to the NFS server.


For the sake of being specific, the procedures below assume
The procedures below assume:
* your XO-1 laptop's IP Address is <tt>192.168.1.250</tt>;
* your XO laptop's IP Address is <tt>192.168.1.250</tt>;
* the IP Address of the NFS server is <tt>192.168.1.2</tt>;
* the IP Address of the NFS server is <tt>192.168.1.2</tt>;
* you want <tt>/home/johndoe</tt> on the NFS server to be visible as <tt>/mnt</tt> on your XO-1 laptop.
* you want <tt>/home/johndoe</tt> on the NFS server to be visible as <tt>/mnt</tt> on your XO laptop.
To find your XO-1's actual IP Address, do this in Terminal Activity[[Image:Activity-terminal.svg|35px]]:
su -
ifconfig
exit
Look at the lines that start with <tt>inet addr:</tt>. One will show <tt>127.0.0.1</tt>; ignore this one. Likely ignore the one for the mesh network, named <tt>msh0</tt>. The one that's left will be the one you want to use.


To find your XO's actual IP Address, do this in Terminal Activity[[Image:Activity-terminal.svg|35px]]:
=== Installing NFS capability on your XO-1 ===
sudo ifconfig
Look at the lines that start with <tt>inet addr:</tt>. One will show <tt>127.0.0.1</tt>; ignore this one. Likely ignore the one for the mesh network on XO-1, named <tt>msh0</tt>. The one that's left will be the one you want to use.


=== Installing NFS capability on your XO ===
On your XO-1 laptop, in Terminal Activity[[Image:Activity-terminal.svg|35px]], install the <tt>nfs-utils</tt> package:

su -
On your XO laptop, in Terminal Activity[[Image:Activity-terminal.svg|35px]], install the <tt>nfs-utils</tt> package:
yum install nfs-utils
sudo yum install -y nfs-utils
exit
This will cause yum to install the <tt>nfs-utils</tt> package and several other packages it requires. Reply <tt>y</tt> when it asks you for permission.
This will cause yum to install the <tt>nfs-utils</tt> package and several other packages it requires.


: A reboot might be needed after the install, I 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:
: 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 rpcbind restart
Line 32: Line 31:


: might also be enough to fix this.
: might also be enough to fix this.
: -- Grumbel


=== Authorizing your XO-1 for NFS ===
=== Authorizing your XO for NFS ===


On your NFS server, add a line to the <tt>/etc/exports</tt> file and reload nfs:
On your NFS server, add a line to the <tt>/etc/exports</tt> file and reload nfs:
Line 49: Line 47:
mount nfs-server.mynetwork.com:directory mount-point
mount nfs-server.mynetwork.com:directory mount-point


=== Mounting <tt>/home/johndoe</tt> on your XO-1 ===
=== Mounting <tt>/home/johndoe</tt> on your XO ===


On your XO-1 laptop, in Terminal Activity[[Image:Activity-terminal.svg|35px]], mount the remote directory:
On your XO laptop, in Terminal Activity[[Image:Activity-terminal.svg|35px]], mount the remote directory:
sudo mount 192.168.1.2:/home/johndoe /mnt
su -
mount 192.168.1.2:/home/johndoe /mnt
exit
exit


== Using NFS mounts ==
== Using NFS mounts ==


Refer to files and directories of a NFS-mounted filesystem by mount-point, just as if they resided on your XO-1 laptop.
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-1 ===
=== Using NFS-mounted files on your XO ===


Suppose that <tt>/home/johndoe/public_html/index.html</tt> is the index to John Doe's webpage. In the Browse Activity[[Image:Activity-web.svg|35px]], give this as the location you wish to browse to:
Suppose that <tt>/home/johndoe/public_html/index.html</tt> is the index to John Doe's webpage. In the Browse Activity[[Image:Activity-web.svg|35px]], give this as the location you wish to browse to:
file:///mnt/public_html/index.html
file:///mnt/public_html/index.html

== See Also ==
* [[Forth_Lesson_12#Other_network_protocols Open Firmware booting using NFS]]

Revision as of 06:19, 13 August 2013

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