Source string Read only

(itstool) path: step/para
Context English State
Export the diskless root directory via <acronym>NFS</acronym> by adding the following to <filename>/etc/exports</filename>:
/b -ro -alldirs -maproot=root
Start the <acronym>NFS</acronym> server:
Enable <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry> by adding the following line to <filename>/etc/rc.conf</filename>:
Uncomment the following line in <filename>/etc/inetd.conf</filename> by making sure it does not start with a <literal>#</literal> symbol:
tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /b/tftpboot
Some <acronym>PXE</acronym> versions require the <acronym>TCP</acronym> version of <acronym>TFTP</acronym>. In this case, uncomment the second <literal>tftp</literal> line which contains <literal>stream tcp</literal>.
Start <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>:
Install the base system into <filename>${NFSROOTDIR}</filename>, either by decompressing the official archives or by rebuilding the FreeBSD kernel and userland (refer to <xref linkend="makeworld"/> for more detailed instructions, but do not forget to add <option>DESTDIR=<replaceable>${NFSROOTDIR}</replaceable></option> when running the <command>make installkernel</command> and <command>make installworld</command> commands.
Test that the <acronym>TFTP</acronym> server works and can download the boot loader which will be obtained via <acronym>PXE</acronym>:
<prompt>#</prompt> <userinput>tftp localhost</userinput>
tftp&gt; <userinput>get FreeBSD/install/boot/pxeboot</userinput>
Received 264951 bytes in 0.1 seconds
Edit <filename>${NFSROOTDIR}/etc/fstab</filename> and create an entry to mount the root file system over <acronym>NFS</acronym>:
# Device Mountpoint FSType Options Dump Pass
<replaceable></replaceable>:/b/tftpboot/FreeBSD/install / nfs ro 0 0
Replace <replaceable></replaceable> with the hostname or <acronym>IP</acronym> address of the <acronym>NFS</acronym> server. In this example, the root file system is mounted read-only in order to prevent <acronym>NFS</acronym> clients from potentially deleting the contents of the root file system.
Set the root password in the <acronym>PXE</acronym> environment for client machines which are <acronym>PXE</acronym> booting :
<prompt>#</prompt> <userinput>chroot ${NFSROOTDIR}</userinput>
<prompt>#</prompt> <userinput>passwd</userinput>
If needed, enable <citerefentry><refentrytitle>ssh</refentrytitle><manvolnum>1</manvolnum></citerefentry> root logins for client machines which are <acronym>PXE</acronym> booting by editing <filename>${NFSROOTDIR}/etc/ssh/sshd_config</filename> and enabling <literal>PermitRootLogin</literal>. This option is documented in <citerefentry><refentrytitle>sshd_config</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
Perform any other needed customizations of the <acronym>PXE</acronym> environment in <filename>${NFSROOTDIR}</filename>. These customizations could include things like installing packages or editing the password file with <citerefentry><refentrytitle>vipw</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
When booting from an <acronym>NFS</acronym> root volume, <filename>/etc/rc</filename> detects the <acronym>NFS</acronym> boot and runs <filename>/etc/rc.initdiskless</filename>. In this case, <filename>/etc</filename> and <filename>/var</filename> need to be memory backed file systems so that these directories are writable but the <acronym>NFS</acronym> root directory is read-only:
<prompt>#</prompt> <userinput>chroot ${NFSROOTDIR}</userinput>
<prompt>#</prompt> <userinput>mkdir -p conf/base</userinput>
<prompt>#</prompt> <userinput>tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc</userinput>
<prompt>#</prompt> <userinput>tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var</userinput>
When the system boots, memory file systems for <filename>/etc</filename> and <filename>/var</filename> will be created and mounted and the contents of the <filename>cpio.gz</filename> files will be copied into them. By default, these file systems have a maximum capacity of 5 megabytes. If your archives do not fit, which is usually the case for <filename>/var</filename> when binary packages have been installed, request a larger size by putting the number of 512 byte sectors needed (e.g., 5 megabytes is 10240 sectors) in <filename>${NFSROOTDIR}/conf/base/etc/md_size</filename> and <filename>${NFSROOTDIR}/conf/base/var/md_size</filename> files for <filename>/etc</filename> and <filename>/var</filename> file systems respectively.
Configuring the <acronym>DHCP</acronym> Server
<primary>DHCP</primary> <secondary>diskless operation</secondary>
The <acronym>DHCP</acronym> server does not need to be the same machine as the <acronym>TFTP</acronym> and <acronym>NFS</acronym> server, but it needs to be accessible in the network.
<acronym>DHCP</acronym> is not part of the FreeBSD base system but can be installed using the <package>net/isc-dhcp43-server</package> port or package.
Once installed, edit the configuration file, <filename>/usr/local/etc/dhcpd.conf</filename>. Configure the <literal>next-server</literal>, <literal>filename</literal>, and <literal>root-path</literal> settings as seen in this example:
subnet netmask {
range ;
option subnet-mask ;
option routers ;
option broadcast-address ;
option domain-name-servers, ;
option domain-name "";

# IP address of TFTP server
next-server <replaceable></replaceable> ;

# path of boot loader obtained via tftp
filename "<replaceable>FreeBSD/install/boot/pxeboot</replaceable>" ;

# pxeboot boot loader will try to NFS mount this directory for root FS
option root-path "<replaceable></replaceable>" ;

The <literal>next-server</literal> directive is used to specify the <acronym>IP</acronym> address of the <acronym>TFTP</acronym> server.
The <literal>filename</literal> directive defines the path to <filename>/boot/pxeboot</filename>. A relative filename is used, meaning that <filename>/b/tftpboot</filename> is not included in the path.
The <literal>root-path</literal> option defines the path to the <acronym>NFS</acronym> root file system.


No matching activity found.

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: step/para
Source string location
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 10816