Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] nfs: Update Documentation/nfsroot.txt to include dhcp, syslinux and isolinux

* Document the ip command a little differently to make the
interaction between defaults and autoconfiguration a little clearer
(I hope)

* Update autoconfiguration the current set of options, including DHCP

* Update the boot methods to add syslinux and isolinux, and remove
dd of=/dev/fd0 which is no longer supported by linux

* Add a referance to initramfs along side initrd.
Should the latter and its document be removed some time soon?

* Various cleanups to put the text consistently into the thrid person

* Reformated a bit to fit into 80 columns a bit more nicely

* Should the bootloaders documentation be removed or split
into a separate documentation, it seems somewhat out of scope

Signed-off-by: Horms <horms@verge.net.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Horms and committed by
Linus Torvalds
64552a50 73ce5934

+165 -120
+165 -120
Documentation/nfsroot.txt
··· 4 4 Written 1996 by Gero Kuhlmann <gero@gkminix.han.de> 5 5 Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 6 6 Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org> 7 + Updated 2006 by Horms <horms@verge.net.au> 7 8 8 9 9 10 10 - If you want to use a diskless system, as an X-terminal or printer 11 - server for example, you have to put your root filesystem onto a 12 - non-disk device. This can either be a ramdisk (see initrd.txt in 13 - this directory for further information) or a filesystem mounted 14 - via NFS. The following text describes on how to use NFS for the 15 - root filesystem. For the rest of this text 'client' means the 11 + In order to use a diskless system, such as an X-terminal or printer server 12 + for example, it is necessary for the root filesystem to be present on a 13 + non-disk device. This may be an initramfs (see Documentation/filesystems/ 14 + ramfs-rootfs-initramfs.txt), a ramdisk (see Documenation/initrd.txt) or a 15 + filesystem mounted via NFS. The following text describes on how to use NFS 16 + for the root filesystem. For the rest of this text 'client' means the 16 17 diskless system, and 'server' means the NFS server. 17 18 18 19 ··· 22 21 1.) Enabling nfsroot capabilities 23 22 ----------------------------- 24 23 25 - In order to use nfsroot you have to select support for NFS during 26 - kernel configuration. Note that NFS cannot be loaded as a module 27 - in this case. The configuration script will then ask you whether 28 - you want to use nfsroot, and if yes what kind of auto configuration 29 - system you want to use. Selecting both BOOTP and RARP is safe. 24 + In order to use nfsroot, NFS client support needs to be selected as 25 + built-in during configuration. Once this has been selected, the nfsroot 26 + option will become available, which should also be selected. 27 + 28 + In the networking options, kernel level autoconfiguration can be selected, 29 + along with the types of autoconfiguration to support. Selecting all of 30 + DHCP, BOOTP and RARP is safe. 30 31 31 32 32 33 ··· 36 33 2.) Kernel command line 37 34 ------------------- 38 35 39 - When the kernel has been loaded by a boot loader (either by loadlin, 40 - LILO or a network boot program) it has to be told what root fs device 41 - to use, and where to find the server and the name of the directory 42 - on the server to mount as root. This can be established by a couple 43 - of kernel command line parameters: 36 + When the kernel has been loaded by a boot loader (see below) it needs to be 37 + told what root fs device to use. And in the case of nfsroot, where to find 38 + both the server and the name of the directory on the server to mount as root. 39 + This can be established using the following kernel command line parameters: 44 40 45 41 46 42 root=/dev/nfs ··· 51 49 52 50 nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] 53 51 54 - If the `nfsroot' parameter is NOT given on the command line, the default 55 - "/tftpboot/%s" will be used. 52 + If the `nfsroot' parameter is NOT given on the command line, 53 + the default "/tftpboot/%s" will be used. 56 54 57 - <server-ip> Specifies the IP address of the NFS server. If this field 58 - is not given, the default address as determined by the 59 - `ip' variable (see below) is used. One use of this 60 - parameter is for example to allow using different servers 61 - for RARP and NFS. Usually you can leave this blank. 55 + <server-ip> Specifies the IP address of the NFS server. 56 + The default address is determined by the `ip' parameter 57 + (see below). This parameter allows the use of different 58 + servers for IP autoconfiguration and NFS. 62 59 63 - <root-dir> Name of the directory on the server to mount as root. If 64 - there is a "%s" token in the string, the token will be 65 - replaced by the ASCII-representation of the client's IP 66 - address. 60 + <root-dir> Name of the directory on the server to mount as root. 61 + If there is a "%s" token in the string, it will be 62 + replaced by the ASCII-representation of the client's 63 + IP address. 67 64 68 65 <nfs-options> Standard NFS options. All options are separated by commas. 69 - If the options field is not given, the following defaults 70 - will be used: 66 + The following defaults are used: 71 67 port = as given by server portmap daemon 72 68 rsize = 1024 73 69 wsize = 1024 ··· 81 81 ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> 82 82 83 83 This parameter tells the kernel how to configure IP addresses of devices 84 - and also how to set up the IP routing table. It was originally called `nfsaddrs', 85 - but now the boot-time IP configuration works independently of NFS, so it 86 - was renamed to `ip' and the old name remained as an alias for compatibility 87 - reasons. 84 + and also how to set up the IP routing table. It was originally called 85 + `nfsaddrs', but now the boot-time IP configuration works independently of 86 + NFS, so it was renamed to `ip' and the old name remained as an alias for 87 + compatibility reasons. 88 88 89 89 If this parameter is missing from the kernel command line, all fields are 90 90 assumed to be empty, and the defaults mentioned below apply. In general 91 - this means that the kernel tries to configure everything using both 92 - RARP and BOOTP (depending on what has been enabled during kernel confi- 93 - guration, and if both what protocol answer got in first). 94 - 95 - <client-ip> IP address of the client. If empty, the address will either 96 - be determined by RARP or BOOTP. What protocol is used de- 97 - pends on what has been enabled during kernel configuration 98 - and on the <autoconf> parameter. If this parameter is not 99 - empty, neither RARP nor BOOTP will be used. 100 - 101 - <server-ip> IP address of the NFS server. If RARP is used to determine 102 - the client address and this parameter is NOT empty only 103 - replies from the specified server are accepted. To use 104 - different RARP and NFS server, specify your RARP server 105 - here (or leave it blank), and specify your NFS server in 106 - the `nfsroot' parameter (see above). If this entry is blank 107 - the address of the server is used which answered the RARP 108 - or BOOTP request. 109 - 110 - <gw-ip> IP address of a gateway if the server is on a different 111 - subnet. If this entry is empty no gateway is used and the 112 - server is assumed to be on the local network, unless a 113 - value has been received by BOOTP. 114 - 115 - <netmask> Netmask for local network interface. If this is empty, 116 - the netmask is derived from the client IP address assuming 117 - classful addressing, unless overridden in BOOTP reply. 118 - 119 - <hostname> Name of the client. If empty, the client IP address is 120 - used in ASCII notation, or the value received by BOOTP. 121 - 122 - <device> Name of network device to use. If this is empty, all 123 - devices are used for RARP and BOOTP requests, and the 124 - first one we receive a reply on is configured. If you have 125 - only one device, you can safely leave this blank. 126 - 127 - <autoconf> Method to use for autoconfiguration. If this is either 128 - 'rarp' or 'bootp', the specified protocol is used. 129 - If the value is 'both' or empty, both protocols are used 130 - so far as they have been enabled during kernel configura- 131 - tion. 'off' means no autoconfiguration. 91 + this means that the kernel tries to configure everything using 92 + autoconfiguration. 132 93 133 94 The <autoconf> parameter can appear alone as the value to the `ip' 134 95 parameter (without all the ':' characters before) in which case auto- 135 96 configuration is used. 136 97 98 + <client-ip> IP address of the client. 99 + 100 + Default: Determined using autoconfiguration. 101 + 102 + <server-ip> IP address of the NFS server. If RARP is used to determine 103 + the client address and this parameter is NOT empty only 104 + replies from the specified server are accepted. 105 + 106 + Only required for for NFS root. That is autoconfiguration 107 + will not be triggered if it is missing and NFS root is not 108 + in operation. 109 + 110 + Default: Determined using autoconfiguration. 111 + The address of the autoconfiguration server is used. 112 + 113 + <gw-ip> IP address of a gateway if the server is on a different subnet. 114 + 115 + Default: Determined using autoconfiguration. 116 + 117 + <netmask> Netmask for local network interface. If unspecified 118 + the netmask is derived from the client IP address assuming 119 + classful addressing. 120 + 121 + Default: Determined using autoconfiguration. 122 + 123 + <hostname> Name of the client. May be supplied by autoconfiguration, 124 + but its absence will not trigger autoconfiguration. 125 + 126 + Default: Client IP address is used in ASCII notation. 127 + 128 + <device> Name of network device to use. 129 + 130 + Default: If the host only has one device, it is used. 131 + Otherwise the device is determined using 132 + autoconfiguration. This is done by sending 133 + autoconfiguration requests out of all devices, 134 + and using the device that received the first reply. 135 + 136 + <autoconf> Method to use for autoconfiguration. In the case of options 137 + which specify multiple autoconfiguration protocols, 138 + requests are sent using all protocols, and the first one 139 + to reply is used. 140 + 141 + Only autoconfiguration protocols that have been compiled 142 + into the kernel will be used, regardless of the value of 143 + this option. 144 + 145 + off or none: don't use autoconfiguration (default) 146 + on or any: use any protocol available in the kernel 147 + dhcp: use DHCP 148 + bootp: use BOOTP 149 + rarp: use RARP 150 + both: use both BOOTP and RARP but not DHCP 151 + (old option kept for backwards compatibility) 152 + 153 + Default: any 137 154 138 155 139 156 140 - 3.) Kernel loader 141 - ------------- 142 157 143 - To get the kernel into memory different approaches can be used. They 144 - depend on what facilities are available: 158 + 3.) Boot Loader 159 + ---------- 160 + 161 + To get the kernel into memory different approaches can be used. 162 + They depend on various facilities being available: 145 163 146 164 147 - 3.1) Writing the kernel onto a floppy using dd: 148 - As always you can just write the kernel onto a floppy using dd, 149 - but then it's not possible to use kernel command lines at all. 150 - To substitute the 'root=' parameter, create a dummy device on any 151 - linux system with major number 0 and minor number 255 using mknod: 165 + 3.1) Booting from a floppy using syslinux 152 166 153 - mknod /dev/boot255 c 0 255 167 + When building kernels, an easy way to create a boot floppy that uses 168 + syslinux is to use the zdisk or bzdisk make targets which use 169 + and bzimage images respectively. Both targets accept the 170 + FDARGS parameter which can be used to set the kernel command line. 154 171 155 - Then copy the kernel zImage file onto a floppy using dd: 172 + e.g. 173 + make bzdisk FDARGS="root=/dev/nfs" 156 174 157 - dd if=/usr/src/linux/arch/i386/boot/zImage of=/dev/fd0 175 + Note that the user running this command will need to have 176 + access to the floppy drive device, /dev/fd0 158 177 159 - And finally use rdev to set the root device: 178 + For more information on syslinux, including how to create bootdisks 179 + for prebuilt kernels, see http://syslinux.zytor.com/ 160 180 161 - rdev /dev/fd0 /dev/boot255 181 + N.B: Previously it was possible to write a kernel directly to 182 + a floppy using dd, configure the boot device using rdev, and 183 + boot using the resulting floppy. Linux no longer supports this 184 + method of booting. 162 185 163 - You can then remove the dummy device /dev/boot255 again. There 164 - is no real device available for it. 165 - The other two kernel command line parameters cannot be substi- 166 - tuted with rdev. Therefore, using this method the kernel will 167 - by default use RARP and/or BOOTP, and if it gets an answer via 168 - RARP will mount the directory /tftpboot/<client-ip>/ as its 169 - root. If it got a BOOTP answer the directory name in that answer 170 - is used. 186 + 3.2) Booting from a cdrom using isolinux 187 + 188 + When building kernels, an easy way to create a bootable cdrom that 189 + uses isolinux is to use the isoimage target which uses a bzimage 190 + image. Like zdisk and bzdisk, this target accepts the FDARGS 191 + parameter which can be used to set the kernel command line. 192 + 193 + e.g. 194 + make isoimage FDARGS="root=/dev/nfs" 195 + 196 + The resulting iso image will be arch/<ARCH>/boot/image.iso 197 + This can be written to a cdrom using a variety of tools including 198 + cdrecord. 199 + 200 + e.g. 201 + cdrecord dev=ATAPI:1,0,0 arch/i386/boot/image.iso 202 + 203 + For more information on isolinux, including how to create bootdisks 204 + for prebuilt kernels, see http://syslinux.zytor.com/ 171 205 172 206 3.2) Using LILO 173 - When using LILO you can specify all necessary command line 174 - parameters with the 'append=' command in the LILO configuration 175 - file. However, to use the 'root=' command you also need to 176 - set up a dummy device as described in 3.1 above. For how to use 177 - LILO and its 'append=' command please refer to the LILO 178 - documentation. 207 + When using LILO all the necessary command line parameters may be 208 + specified using the 'append=' directive in the LILO configuration 209 + file. 210 + 211 + However, to use the 'root=' directive you also need to create 212 + a dummy root device, which may be removed after LILO is run. 213 + 214 + mknod /dev/boot255 c 0 255 215 + 216 + For information on configuring LILO, please refer to its documentation. 179 217 180 218 3.3) Using GRUB 181 - When you use GRUB, you simply append the parameters after the kernel 182 - specification: "kernel <kernel> <parameters>" (without the quotes). 219 + When using GRUB, kernel parameter are simply appended after the kernel 220 + specification: kernel <kernel> <parameters> 183 221 184 222 3.4) Using loadlin 185 - When you want to boot Linux from a DOS command prompt without 186 - having a local hard disk to mount as root, you can use loadlin. 187 - I was told that it works, but haven't used it myself yet. In 188 - general you should be able to create a kernel command line simi- 189 - lar to how LILO is doing it. Please refer to the loadlin docu- 190 - mentation for further information. 223 + loadlin may be used to boot Linux from a DOS command prompt without 224 + requiring a local hard disk to mount as root. This has not been 225 + thoroughly tested by the authors of this document, but in general 226 + it should be possible configure the kernel command line similarly 227 + to the configuration of LILO. 228 + 229 + Please refer to the loadlin documentation for further information. 191 230 192 231 3.5) Using a boot ROM 193 - This is probably the most elegant way of booting a diskless 194 - client. With a boot ROM the kernel gets loaded using the TFTP 195 - protocol. As far as I know, no commercial boot ROMs yet 196 - support booting Linux over the network, but there are two 197 - free implementations of a boot ROM available on sunsite.unc.edu 198 - and its mirrors. They are called 'netboot-nfs' and 'etherboot'. 199 - Both contain everything you need to boot a diskless Linux client. 232 + This is probably the most elegant way of booting a diskless client. 233 + With a boot ROM the kernel is loaded using the TFTP protocol. The 234 + authors of this document are not aware of any no commercial boot 235 + ROMs that support booting Linux over the network. However, there 236 + are two free implementations of a boot ROM, netboot-nfs and 237 + etherboot, both of which are available on sunsite.unc.edu, and both 238 + of which contain everything you need to boot a diskless Linux client. 200 239 201 240 3.6) Using pxelinux 202 - Using pxelinux you specify the kernel you built with 241 + Pxelinux may be used to boot linux using the PXE boot loader 242 + which is present on many modern network cards. 243 + 244 + When using pxelinux, the kernel image is specified using 203 245 "kernel <relative-path-below /tftpboot>". The nfsroot parameters 204 246 are passed to the kernel by adding them to the "append" line. 205 - You may perhaps also want to fine tune the console output, 206 - see Documentation/serial-console.txt for serial console help. 247 + It is common to use serial console in conjunction with pxeliunx, 248 + see Documentation/serial-console.txt for more information. 249 + 250 + For more information on isolinux, including how to create bootdisks 251 + for prebuilt kernels, see http://syslinux.zytor.com/ 207 252 208 253 209 254