Commit f9a93498 authored by Daniel W. S. Almeida's avatar Daniel W. S. Almeida Committed by Jonathan Corbet

Documentation: nfsroot.txt: convert to ReST

Convert nfsroot.txt to RST and move it to admin-guide. Content remains
mostly the same.
Signed-off-by: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
Link: https://lore.kernel.org/r/442d35917351f5260dd8ed7362e9b5f1264ef8ad.1578697871.git.dwlsalmeida@gmail.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 2f123b9a
...@@ -6,3 +6,4 @@ NFS ...@@ -6,3 +6,4 @@ NFS
:maxdepth: 1 :maxdepth: 1
nfs-client nfs-client
nfsroot
===============================================
Mounting the root filesystem via NFS (nfsroot) Mounting the root filesystem via NFS (nfsroot)
=============================================== ===============================================
Written 1996 by Gero Kuhlmann <gero@gkminix.han.de> :Authors:
Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz> Written 1996 by Gero Kuhlmann <gero@gkminix.han.de>
Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org>
Updated 2006 by Horms <horms@verge.net.au> Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
Updated 2018 by Chris Novakovic <chris@chrisn.me.uk>
Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org>
Updated 2006 by Horms <horms@verge.net.au>
Updated 2018 by Chris Novakovic <chris@chrisn.me.uk>
In order to use a diskless system, such as an X-terminal or printer server In order to use a diskless system, such as an X-terminal or printer server
for example, it is necessary for the root filesystem to be present on a for example, it is necessary for the root filesystem to be present on a
non-disk device. This may be an initramfs (see Documentation/filesystems/ non-disk device. This may be an initramfs (see Documentation/filesystems/ramfs-rootfs-initramfs.txt),
ramfs-rootfs-initramfs.txt), a ramdisk (see Documentation/admin-guide/initrd.rst) or a a ramdisk (see Documentation/admin-guide/initrd.rst) or a
filesystem mounted via NFS. The following text describes on how to use NFS filesystem mounted via NFS. The following text describes on how to use NFS
for the root filesystem. For the rest of this text 'client' means the for the root filesystem. For the rest of this text 'client' means the
diskless system, and 'server' means the NFS server. diskless system, and 'server' means the NFS server.
...@@ -20,8 +26,8 @@ diskless system, and 'server' means the NFS server. ...@@ -20,8 +26,8 @@ diskless system, and 'server' means the NFS server.
1.) Enabling nfsroot capabilities Enabling nfsroot capabilities
----------------------------- =============================
In order to use nfsroot, NFS client support needs to be selected as In order to use nfsroot, NFS client support needs to be selected as
built-in during configuration. Once this has been selected, the nfsroot built-in during configuration. Once this has been selected, the nfsroot
...@@ -34,8 +40,8 @@ DHCP, BOOTP and RARP is safe. ...@@ -34,8 +40,8 @@ DHCP, BOOTP and RARP is safe.
2.) Kernel command line Kernel command line
------------------- ===================
When the kernel has been loaded by a boot loader (see below) it needs to be When the kernel has been loaded by a boot loader (see below) it needs to be
told what root fs device to use. And in the case of nfsroot, where to find told what root fs device to use. And in the case of nfsroot, where to find
...@@ -44,19 +50,17 @@ This can be established using the following kernel command line parameters: ...@@ -44,19 +50,17 @@ This can be established using the following kernel command line parameters:
root=/dev/nfs root=/dev/nfs
This is necessary to enable the pseudo-NFS-device. Note that it's not a This is necessary to enable the pseudo-NFS-device. Note that it's not a
real device but just a synonym to tell the kernel to use NFS instead of real device but just a synonym to tell the kernel to use NFS instead of
a real device. a real device.
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
If the `nfsroot' parameter is NOT given on the command line, If the `nfsroot' parameter is NOT given on the command line,
the default "/tftpboot/%s" will be used. the default ``"/tftpboot/%s"`` will be used.
<server-ip> Specifies the IP address of the NFS server. <server-ip> Specifies the IP address of the NFS server.
The default address is determined by the `ip' parameter The default address is determined by the ip parameter
(see below). This parameter allows the use of different (see below). This parameter allows the use of different
servers for IP autoconfiguration and NFS. servers for IP autoconfiguration and NFS.
...@@ -66,7 +70,8 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] ...@@ -66,7 +70,8 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
IP address. IP address.
<nfs-options> Standard NFS options. All options are separated by commas. <nfs-options> Standard NFS options. All options are separated by commas.
The following defaults are used: The following defaults are used::
port = as given by server portmap daemon port = as given by server portmap daemon
rsize = 4096 rsize = 4096
wsize = 4096 wsize = 4096
...@@ -79,13 +84,11 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] ...@@ -79,13 +84,11 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
flags = hard, nointr, noposix, cto, ac flags = hard, nointr, noposix, cto, ac
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip>:<ntp0-ip>
<dns0-ip>:<dns1-ip>:<ntp0-ip>
This parameter tells the kernel how to configure IP addresses of devices This parameter tells the kernel how to configure IP addresses of devices
and also how to set up the IP routing table. It was originally called and also how to set up the IP routing table. It was originally called
`nfsaddrs', but now the boot-time IP configuration works independently of nfsaddrs, but now the boot-time IP configuration works independently of
NFS, so it was renamed to `ip' and the old name remained as an alias for NFS, so it was renamed to ip and the old name remained as an alias for
compatibility reasons. compatibility reasons.
If this parameter is missing from the kernel command line, all fields are If this parameter is missing from the kernel command line, all fields are
...@@ -93,17 +96,17 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: ...@@ -93,17 +96,17 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
this means that the kernel tries to configure everything using this means that the kernel tries to configure everything using
autoconfiguration. autoconfiguration.
The <autoconf> parameter can appear alone as the value to the `ip' The <autoconf> parameter can appear alone as the value to the ip
parameter (without all the ':' characters before). If the value is parameter (without all the ':' characters before). If the value is
"ip=off" or "ip=none", no autoconfiguration will take place, otherwise "ip=off" or "ip=none", no autoconfiguration will take place, otherwise
autoconfiguration will take place. The most common way to use this autoconfiguration will take place. The most common way to use this
is "ip=dhcp". is "ip=dhcp".
<client-ip> IP address of the client. <client-ip> IP address of the client.
Default: Determined using autoconfiguration. Default: Determined using autoconfiguration.
<server-ip> IP address of the NFS server. If RARP is used to determine <server-ip> IP address of the NFS server.
If RARP is used to determine
the client address and this parameter is NOT empty only the client address and this parameter is NOT empty only
replies from the specified server are accepted. replies from the specified server are accepted.
...@@ -118,16 +121,16 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: ...@@ -118,16 +121,16 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
The address of the autoconfiguration server is used. The address of the autoconfiguration server is used.
<gw-ip> IP address of a gateway if the server is on a different subnet. <gw-ip> IP address of a gateway if the server is on a different subnet.
Default: Determined using autoconfiguration. Default: Determined using autoconfiguration.
<netmask> Netmask for local network interface. If unspecified <netmask> Netmask for local network interface.
the netmask is derived from the client IP address assuming If unspecified the netmask is derived from the client IP address
classful addressing. assuming classful addressing.
Default: Determined using autoconfiguration. Default: Determined using autoconfiguration.
<hostname> Name of the client. If a '.' character is present, anything <hostname> Name of the client.
If a '.' character is present, anything
before the first '.' is used as the client's hostname, and anything before the first '.' is used as the client's hostname, and anything
after it is used as its NIS domain name. May be supplied by after it is used as its NIS domain name. May be supplied by
autoconfiguration, but its absence will not trigger autoconfiguration. autoconfiguration, but its absence will not trigger autoconfiguration.
...@@ -138,21 +141,21 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: ...@@ -138,21 +141,21 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
Default: Client IP address is used in ASCII notation. Default: Client IP address is used in ASCII notation.
<device> Name of network device to use. <device> Name of network device to use.
Default: If the host only has one device, it is used. Default: If the host only has one device, it is used.
Otherwise the device is determined using Otherwise the device is determined using
autoconfiguration. This is done by sending autoconfiguration. This is done by sending
autoconfiguration requests out of all devices, autoconfiguration requests out of all devices,
and using the device that received the first reply. and using the device that received the first reply.
<autoconf> Method to use for autoconfiguration. In the case of options <autoconf> Method to use for autoconfiguration.
In the case of options
which specify multiple autoconfiguration protocols, which specify multiple autoconfiguration protocols,
requests are sent using all protocols, and the first one requests are sent using all protocols, and the first one
to reply is used. to reply is used.
Only autoconfiguration protocols that have been compiled Only autoconfiguration protocols that have been compiled
into the kernel will be used, regardless of the value of into the kernel will be used, regardless of the value of
this option. this option::
off or none: don't use autoconfiguration off or none: don't use autoconfiguration
(do static IP assignment instead) (do static IP assignment instead)
...@@ -221,7 +224,6 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: ...@@ -221,7 +224,6 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
nfsrootdebug nfsrootdebug
This parameter enables debugging messages to appear in the kernel This parameter enables debugging messages to appear in the kernel
log at boot time so that administrators can verify that the correct log at boot time so that administrators can verify that the correct
NFS mount options, server address, and root path are passed to the NFS mount options, server address, and root path are passed to the
...@@ -229,36 +231,32 @@ nfsrootdebug ...@@ -229,36 +231,32 @@ nfsrootdebug
rdinit=<executable file> rdinit=<executable file>
To specify which file contains the program that starts system To specify which file contains the program that starts system
initialization, administrators can use this command line parameter. initialization, administrators can use this command line parameter.
The default value of this parameter is "/init". If the specified The default value of this parameter is "/init". If the specified
file exists and the kernel can execute it, root filesystem related file exists and the kernel can execute it, root filesystem related
kernel command line parameters, including `nfsroot=', are ignored. kernel command line parameters, including 'nfsroot=', are ignored.
A description of the process of mounting the root file system can be A description of the process of mounting the root file system can be
found in: found in Documentation/driver-api/early-userspace/early_userspace_support.rst
Documentation/driver-api/early-userspace/early_userspace_support.rst
3.) Boot Loader Boot Loader
---------- ===========
To get the kernel into memory different approaches can be used. To get the kernel into memory different approaches can be used.
They depend on various facilities being available: They depend on various facilities being available:
3.1) Booting from a floppy using syslinux - Booting from a floppy using syslinux
When building kernels, an easy way to create a boot floppy that uses When building kernels, an easy way to create a boot floppy that uses
syslinux is to use the zdisk or bzdisk make targets which use zimage syslinux is to use the zdisk or bzdisk make targets which use zimage
and bzimage images respectively. Both targets accept the and bzimage images respectively. Both targets accept the
FDARGS parameter which can be used to set the kernel command line. FDARGS parameter which can be used to set the kernel command line.
e.g. e.g::
make bzdisk FDARGS="root=/dev/nfs" make bzdisk FDARGS="root=/dev/nfs"
Note that the user running this command will need to have Note that the user running this command will need to have
...@@ -267,32 +265,36 @@ They depend on various facilities being available: ...@@ -267,32 +265,36 @@ They depend on various facilities being available:
For more information on syslinux, including how to create bootdisks For more information on syslinux, including how to create bootdisks
for prebuilt kernels, see http://syslinux.zytor.com/ for prebuilt kernels, see http://syslinux.zytor.com/
N.B: Previously it was possible to write a kernel directly to .. note::
Previously it was possible to write a kernel directly to
a floppy using dd, configure the boot device using rdev, and a floppy using dd, configure the boot device using rdev, and
boot using the resulting floppy. Linux no longer supports this boot using the resulting floppy. Linux no longer supports this
method of booting. method of booting.
3.2) Booting from a cdrom using isolinux - Booting from a cdrom using isolinux
When building kernels, an easy way to create a bootable cdrom that When building kernels, an easy way to create a bootable cdrom that
uses isolinux is to use the isoimage target which uses a bzimage uses isolinux is to use the isoimage target which uses a bzimage
image. Like zdisk and bzdisk, this target accepts the FDARGS image. Like zdisk and bzdisk, this target accepts the FDARGS
parameter which can be used to set the kernel command line. parameter which can be used to set the kernel command line.
e.g. e.g::
make isoimage FDARGS="root=/dev/nfs" make isoimage FDARGS="root=/dev/nfs"
The resulting iso image will be arch/<ARCH>/boot/image.iso The resulting iso image will be arch/<ARCH>/boot/image.iso
This can be written to a cdrom using a variety of tools including This can be written to a cdrom using a variety of tools including
cdrecord. cdrecord.
e.g. e.g::
cdrecord dev=ATAPI:1,0,0 arch/x86/boot/image.iso cdrecord dev=ATAPI:1,0,0 arch/x86/boot/image.iso
For more information on isolinux, including how to create bootdisks For more information on isolinux, including how to create bootdisks
for prebuilt kernels, see http://syslinux.zytor.com/ for prebuilt kernels, see http://syslinux.zytor.com/
3.2) Using LILO - Using LILO
When using LILO all the necessary command line parameters may be When using LILO all the necessary command line parameters may be
specified using the 'append=' directive in the LILO configuration specified using the 'append=' directive in the LILO configuration
file. file.
...@@ -300,15 +302,19 @@ They depend on various facilities being available: ...@@ -300,15 +302,19 @@ They depend on various facilities being available:
However, to use the 'root=' directive you also need to create However, to use the 'root=' directive you also need to create
a dummy root device, which may be removed after LILO is run. a dummy root device, which may be removed after LILO is run.
e.g::
mknod /dev/boot255 c 0 255 mknod /dev/boot255 c 0 255
For information on configuring LILO, please refer to its documentation. For information on configuring LILO, please refer to its documentation.
3.3) Using GRUB - Using GRUB
When using GRUB, kernel parameter are simply appended after the kernel When using GRUB, kernel parameter are simply appended after the kernel
specification: kernel <kernel> <parameters> specification: kernel <kernel> <parameters>
3.4) Using loadlin - Using loadlin
loadlin may be used to boot Linux from a DOS command prompt without loadlin may be used to boot Linux from a DOS command prompt without
requiring a local hard disk to mount as root. This has not been requiring a local hard disk to mount as root. This has not been
thoroughly tested by the authors of this document, but in general thoroughly tested by the authors of this document, but in general
...@@ -317,7 +323,8 @@ They depend on various facilities being available: ...@@ -317,7 +323,8 @@ They depend on various facilities being available:
Please refer to the loadlin documentation for further information. Please refer to the loadlin documentation for further information.
3.5) Using a boot ROM - Using a boot ROM
This is probably the most elegant way of booting a diskless client. This is probably the most elegant way of booting a diskless client.
With a boot ROM the kernel is loaded using the TFTP protocol. The With a boot ROM the kernel is loaded using the TFTP protocol. The
authors of this document are not aware of any no commercial boot authors of this document are not aware of any no commercial boot
...@@ -326,7 +333,8 @@ They depend on various facilities being available: ...@@ -326,7 +333,8 @@ They depend on various facilities being available:
etherboot, both of which are available on sunsite.unc.edu, and both etherboot, both of which are available on sunsite.unc.edu, and both
of which contain everything you need to boot a diskless Linux client. of which contain everything you need to boot a diskless Linux client.
3.6) Using pxelinux - Using pxelinux
Pxelinux may be used to boot linux using the PXE boot loader Pxelinux may be used to boot linux using the PXE boot loader
which is present on many modern network cards. which is present on many modern network cards.
...@@ -342,8 +350,8 @@ They depend on various facilities being available: ...@@ -342,8 +350,8 @@ They depend on various facilities being available:
4.) Credits Credits
------- =======
The nfsroot code in the kernel and the RARP support have been written The nfsroot code in the kernel and the RARP support have been written
by Gero Kuhlmann <gero@gkminix.han.de>. by Gero Kuhlmann <gero@gkminix.han.de>.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment