1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>Network File System (NFS)</title>
7
<link rel="stylesheet" href="../../common/kde-default.css" type="text/css" />
8
<link rel="stylesheet" href="../../common/kubuntu-default.css" type="text/css" />
9
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1" />
10
<link rel="start" href="index.html" title="Ubuntu Server Guide" />
11
<link rel="up" href="networking.html" title="Chapter 4. Networking" />
12
<link rel="prev" href="ftp-server.html" title="FTP Server" />
13
<link rel="next" href="dhcp.html" title="Dynamic Host Configuration Protocol (DHCP)" />
16
<div xmlns="" style="background-image: url(../../common/top-middle.png); width: 100%; height: 131px;">
17
<div style="position: absolute; right: 0px;">
18
<img src="../../common/top-right-konqueror.png" style="margin: 0px" alt="" />
20
<div style="position: absolute; left: 0px;">
21
<img src="../../common/top-left.png" style="margin: 0px" alt="" />
23
<div style="position: absolute; top: 25px; right: 100px; text-align: right; font-size: xx-large; font-weight: bold; text-shadow: #fff 0px 0px 5px; color: #444">Network File System (NFS)</div>
25
<div xmlns="" style="margin-top: 20px; background-color: #white; color: black; margin-left: 20px; margin-right: 20px;">
26
<div style="position: absolute; left: 20px;">
27
<a accesskey="p" href="ftp-server.html">Prev</a>
29
<div style="position: absolute; right: 20px;">
30
<a accesskey="n" href="dhcp.html">Next</a>
32
<div class="navCenter">Networking</div>
34
<div class="sect1" lang="C" xml:lang="C">
35
<div class="titlepage">
38
<h2 class="title" style="clear: both"><a id="network-file-system"></a>Network File System (NFS)</h2>
43
NFS allows a system to share directories and files with others
44
over a network. By using NFS, users and programs can access
45
files on remote systems almost as if they were local files.
48
Some of the most notable benefits that NFS can provide are:
50
<div class="itemizedlist">
53
<p>Local workstations use less disk space because commonly used data
54
can be stored on a single machine and still remain accessible to others
58
<p>There is no need for users to have separate home directories on
59
every network machine. Home directories could be set up on the NFS
60
server and made available throughout the network.</p>
63
<p>Storage devices such as floppy disks, CDROM drives, and USB
64
Thumb drives can be used by other machines on the network. This may
65
reduce the number of removable media drives throughout the
70
<div class="sect2" lang="C" xml:lang="C">
71
<div class="titlepage">
74
<h3 class="title"><a id="nfs-installation"></a>Installation</h3>
79
At a terminal prompt enter the following command to install the NFS
85
<span xmlns="" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span xmlns="http://www.w3.org/1999/xhtml"><strong class="command">sudo apt-get install nfs-kernel-server</strong></span></span>
90
<div class="sect2" lang="C" xml:lang="C">
91
<div class="titlepage">
94
<h3 class="title"><a id="nfs-configuration"></a>Configuration</h3>
99
You can configure the directories to be exported by adding them to
100
the <code class="filename">/etc/exports</code> file. For example:
105
/ubuntu *(ro,sync,no_root_squash)
106
/home *(rw,sync,no_root_squash)
111
You can replace * with one of the hostname formats. Make the
112
hostname declaration as specific as possible so unwanted
113
systems cannot access the NFS mount.
116
To start the NFS server, you can run the following command at a terminal prompt:
121
<span xmlns="" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span xmlns="http://www.w3.org/1999/xhtml"><strong class="command">sudo /etc/init.d/nfs-kernel-server start</strong></span></span>
126
<div class="sect2" lang="C" xml:lang="C">
127
<div class="titlepage">
130
<h3 class="title"><a id="nfs-client-configuration"></a>NFS Client Configuration</h3>
135
Use the <span><strong class="application">mount</strong></span> command to mount a shared NFS directory from
136
another machine, by typing a command line similar to the following at a terminal prompt:
141
<span xmlns="" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span xmlns="http://www.w3.org/1999/xhtml"><strong class="command">sudo mount example.hostname.com:/ubuntu /local/ubuntu</strong></span></span>
145
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
146
<h3 class="title">Warning</h3>
148
The mount point directory <code class="filename">/local/ubuntu</code> must
149
exist. There should be no files or subdirectories in the
150
<code class="filename">/local/ubuntu</code> directory.
154
An alternate way to mount an NFS share from another machine is to
155
add a line to the <code class="filename">/etc/fstab</code> file. The line must state the
156
hostname of the NFS server, the directory on the server being
157
exported, and the directory on the local machine where the NFS
158
share is to be mounted.
161
The general syntax for the line in <code class="filename">/etc/fstab</code>
166
<pre class="programlisting">
167
example.hostname.com:/ubuntu /local/ubuntu nfs rsize=8192,wsize=8192,timeo=14,intr
172
<div class="sect2" lang="C" xml:lang="C">
173
<div class="titlepage">
176
<h3 class="title"><a id="nfs-references"></a>References</h3>
181
<a href="http://nfs.sourceforge.net/" target="_top">Linux NFS faq</a>
185
<div xmlns="" style="background-color: #white; color: black; margin-top: 20px; margin-left: 20px; margin-right: 20px;">
186
<div style="position: absolute; left: 20px;">
187
<a accesskey="p" href="ftp-server.html">Prev</a>
189
<div style="position: absolute; right: 20px;">
190
<a accesskey="n" href="dhcp.html">Next</a>
193
<a accesskey="h" href="index.html">Home</a>
196
<div xmlns="" style="background-color: #white; color: black; margin-left: 20px; margin-right: 20px;">
197
<div class="navLeft">FTP Server </div>
198
<div class="navRight"> Dynamic Host Configuration Protocol (DHCP)</div>
199
<div class="navCenter">
200
<a accesskey="u" href="networking.html">Up</a>
205
<div xmlns="" class="bannerBottom" style="background-image: url(../../common/bottom-middle.png); background-repeat: x-repeat; width: 100%; height: 100px; bottom:0px;">
206
<div class="BannerBottomRight">
207
<img src="../../common/bottom-right.png" style="margin: 0px" alt="" />
209
<div class="bannerBottomLeft">
210
<img src="../../common/bottom-left.png" style="margin: 0px;" alt="" />