Source string Read only

(itstool) path: sect2/programlisting
Context English State
The following <filename>/etc/exports</filename> entries demonstrate how to export file systems. The examples can be modified to match the file systems and client names on the reader's network. There are many options that can be used in this file, but only a few will be mentioned here. See <citerefentry><refentrytitle>exports</refentrytitle><manvolnum>5</manvolnum></citerefentry> for the full list of options.
This example shows how to export <filename>/cdrom</filename> to three hosts named <replaceable>alpha</replaceable>, <replaceable>bravo</replaceable>, and <replaceable>charlie</replaceable>:
/cdrom -ro <replaceable>alpha</replaceable> <replaceable>bravo</replaceable> <replaceable>charlie</replaceable>
The <literal>-ro</literal> flag makes the file system read-only, preventing clients from making any changes to the exported file system. This example assumes that the host names are either in <acronym>DNS</acronym> or in <filename>/etc/hosts</filename>. Refer to <citerefentry><refentrytitle>hosts</refentrytitle><manvolnum>5</manvolnum></citerefentry> if the network does not have a <acronym>DNS</acronym> server.
The next example exports <filename>/home</filename> to three clients by <acronym>IP</acronym> address. This can be useful for networks without <acronym>DNS</acronym> or <filename>/etc/hosts</filename> entries. The <literal>-alldirs</literal> flag allows subdirectories to be mount points. In other words, it will not automatically mount the subdirectories, but will permit the client to mount the directories that are required as needed.
/usr/home -alldirs
This next example exports <filename>/a</filename> so that two clients from different domains may access that file system. The <option>-maproot=root</option> allows <systemitem class="username">root</systemitem> on the remote system to write data on the exported file system as <systemitem class="username">root</systemitem>. If <literal>-maproot=root</literal> is not specified, the client's <systemitem class="username">root</systemitem> user will be mapped to the server's <systemitem class="username">nobody</systemitem> account and will be subject to the access limitations defined for <systemitem class="username">nobody</systemitem>.
/a -maproot=root
A client can only be specified once per file system. For example, if <filename>/usr</filename> is a single file system, these entries would be invalid as both entries specify the same host:
# Invalid when /usr is one file system
/usr/src client
/usr/ports client
The correct format for this situation is to use one entry:
/usr/src /usr/ports client
The following is an example of a valid export list, where <filename>/usr</filename> and <filename>/exports</filename> are local file systems:
# Export src and ports to client01 and client02, but only
# client01 has root privileges on it
/usr/src /usr/ports -maproot=root client01
/usr/src /usr/ports client02
# The client machines have root and can mount anywhere
# on /exports. Anyone in the world can mount /exports/obj read-only
/exports -alldirs -maproot=root client01 client02
/exports/obj -ro
To enable the processes required by the <acronym>NFS</acronym> server at boot time, add these options to <filename>/etc/rc.conf</filename>:
The server can be started now by running this command:
<prompt>#</prompt> <userinput>service nfsd start</userinput>
Whenever the <acronym>NFS</acronym> server is started, <application>mountd</application> also starts automatically. However, <application>mountd</application> only reads <filename>/etc/exports</filename> when it is started. To make subsequent <filename>/etc/exports</filename> edits take effect immediately, force <application>mountd</application> to reread it:
<prompt>#</prompt> <userinput>service mountd reload</userinput>
Configuring the Client
To enable <acronym>NFS</acronym> clients, set this option in each client's <filename>/etc/rc.conf</filename>:
Then, run this command on each <acronym>NFS</acronym> client:
<prompt>#</prompt> <userinput>service nfsclient start</userinput>
The client now has everything it needs to mount a remote file system. In these examples, the server's name is <systemitem>server</systemitem> and the client's name is <systemitem>client</systemitem>. To mount <filename>/home</filename> on <systemitem>server</systemitem> to the <filename>/mnt</filename> mount point on <systemitem>client</systemitem>:
<primary>NFS</primary> <secondary>mounting</secondary>
<prompt>#</prompt> <userinput>mount server:/home /mnt</userinput>
The files and directories in <filename>/home</filename> will now be available on <systemitem>client</systemitem>, in the <filename>/mnt</filename> directory.
To mount a remote file system each time the client boots, add it to <filename>/etc/fstab</filename>:
server:/home /mnt nfs rw 0 0


User avatar None

New source string

FreeBSD Doc / books_handbookEnglish

New source string 4 months ago
Browse all component changes

Things to check

Multiple failing checks

The translations in several languages have failing checks



English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/programlisting
no-wrap, read-only
Source string location
String age
4 months ago
Source string age
4 months ago
Translation file
books/handbook.pot, string 8776