1 ============================================== 2 Mounting the root filesystem via NFS (nfsroot) 3 ============================================== 4 5 :Authors: 6 Written 1996 by Gero Kuhlmann <gero@gkm 7 8 Updated 1997 by Martin Mares <mj@atrey. 9 10 Updated 2006 by Nico Schottelius <nico- 11 12 Updated 2006 by Horms <horms@verge.net. 13 14 Updated 2018 by Chris Novakovic <chris@ 15 16 17 18 In order to use a diskless system, such as an 19 example, it is necessary for the root filesyst 20 device. This may be an initramfs (see 21 Documentation/filesystems/ramfs-rootfs-initram 22 Documentation/admin-guide/initrd.rst) or a fil 23 following text describes on how to use NFS for 24 of this text 'client' means the diskless syste 25 server. 26 27 28 29 30 Enabling nfsroot capabilities 31 ============================= 32 33 In order to use nfsroot, NFS client support ne 34 built-in during configuration. Once this has b 35 option will become available, which should als 36 37 In the networking options, kernel level autoco 38 along with the types of autoconfiguration to s 39 DHCP, BOOTP and RARP is safe. 40 41 42 43 44 Kernel command line 45 =================== 46 47 When the kernel has been loaded by a boot load 48 told what root fs device to use. And in the ca 49 both the server and the name of the directory 50 This can be established using the following ke 51 52 53 root=/dev/nfs 54 This is necessary to enable the pseudo-NFS-d 55 real device but just a synonym to tell the k 56 a real device. 57 58 59 nfsroot=[<server-ip>:]<root-dir>[,<nfs-options 60 If the `nfsroot' parameter is NOT given on t 61 the default ``"/tftpboot/%s"`` will be used. 62 63 <server-ip> Specifies the IP address of th 64 The default address is determi 65 (see below). This parameter al 66 servers for IP autoconfigurati 67 68 <root-dir> Name of the directory on the s 69 If there is a "%s" token in th 70 replaced by the ASCII-represen 71 IP address. 72 73 <nfs-options> Standard NFS options. All opti 74 The following defaults are use 75 76 port = as g 77 rsize = 4096 78 wsize = 4096 79 timeo = 7 80 retrans = 3 81 acregmin = 3 82 acregmax = 60 83 acdirmin = 30 84 acdirmax = 60 85 flags = hard 86 87 88 ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:< 89 This parameter tells the kernel how to confi 90 and also how to set up the IP routing table. 91 nfsaddrs, but now the boot-time IP configura 92 NFS, so it was renamed to ip and the old nam 93 compatibility reasons. 94 95 If this parameter is missing from the kernel 96 assumed to be empty, and the defaults mentio 97 this means that the kernel tries to configur 98 autoconfiguration. 99 100 The <autoconf> parameter can appear alone as 101 parameter (without all the ':' characters be 102 "ip=off" or "ip=none", no autoconfiguration 103 autoconfiguration will take place. The most 104 is "ip=dhcp". 105 106 <client-ip> IP address of the client. 107 Default: Determined using aut 108 109 <server-ip> IP address of the NFS server. 110 If RARP is used to determine 111 the client address and this pa 112 replies from the specified ser 113 114 Only required for NFS root. Th 115 will not be triggered if it is 116 in operation. 117 118 Value is exported to /proc/net 119 (see below). 120 121 Default: Determined using auto 122 The address of the autoconfigu 123 124 <gw-ip> IP address of a gateway if the 125 Default: Determined using auto 126 127 <netmask> Netmask for local network inte 128 If unspecified the netmask is 129 assuming classful addressing. 130 131 Default: Determined using aut 132 133 <hostname> Name of the client. 134 If a '.' character is present, 135 before the first '.' is used a 136 after it is used as its NIS do 137 autoconfiguration, but its abs 138 If specified and DHCP is used, 139 domain name, if present) will 140 may cause a DNS record to be c 141 142 Default: Client IP address is 143 144 <device> Name of network device to use. 145 Default: If the host only has 146 Otherwise the device is determ 147 autoconfiguration. This is don 148 autoconfiguration requests out 149 and using the device that rece 150 151 <autoconf> Method to use for autoconfigur 152 In the case of options 153 which specify multiple autocon 154 requests are sent using all pr 155 to reply is used. 156 157 Only autoconfiguration protoco 158 into the kernel will be used, 159 this option:: 160 161 off or none: don't use autoc 162 (do static IP 163 on or any: use any protoco 164 (default) 165 dhcp: use DHCP 166 bootp: use BOOTP 167 rarp: use RARP 168 both: use both BOOTP 169 (old option kep 170 171 if dhcp is used, the client id 172 format "ip=dhcp,client-id-type 173 174 Default: any 175 176 <dns0-ip> IP address of primary nameserv 177 Value is exported to /proc/net 178 (see below). 179 180 Default: None if not using aut 181 automatically if using autocon 182 183 <dns1-ip> IP address of secondary namese 184 See <dns0-ip>. 185 186 <ntp0-ip> IP address of a Network Time P 187 Value is exported to /proc/net 188 otherwise unused (see below). 189 190 Default: None if not using aut 191 automatically if using autocon 192 193 After configuration (whether manual or autom 194 are created in the following format; lines a 195 value is empty following configuration: 196 197 - /proc/net/pnp: 198 199 #PROTO: <DHCP|BOOTP|RARP|MANUAL> 200 domain <dns-domain> 201 nameserver <dns0-ip> 202 nameserver <dns1-ip> 203 nameserver <dns2-ip> 204 bootserver <server-ip> 205 206 - /proc/net/ipconfig/ntp_servers: 207 208 <ntp0-ip> 209 <ntp1-ip> 210 <ntp2-ip> 211 212 <dns-domain> and <dns2-ip> (in /proc/net/pnp 213 (in /proc/net/ipconfig/ntp_servers) are requ 214 they cannot be specified as part of the "ip= 215 216 Because the "domain" and "nameserver" option 217 resolvers, /etc/resolv.conf is often linked 218 that use an NFS root filesystem. 219 220 Note that the kernel will not synchronise th 221 servers it discovers; this is the responsibi 222 (e.g. an initrd/initramfs script that passes 223 /proc/net/ipconfig/ntp_servers to an NTP cli 224 root filesystem if it is on NFS). 225 226 227 nfsrootdebug 228 This parameter enables debugging messages to 229 log at boot time so that administrators can 230 NFS mount options, server address, and root 231 NFS client. 232 233 234 rdinit=<executable file> 235 To specify which file contains the program t 236 initialization, administrators can use this 237 The default value of this parameter is "/ini 238 file exists and the kernel can execute it, r 239 kernel command line parameters, including 'n 240 241 A description of the process of mounting the 242 found in Documentation/driver-api/early-user 243 244 245 Boot Loader 246 =========== 247 248 To get the kernel into memory different approa 249 They depend on various facilities being availa 250 251 252 - Booting from a floppy using syslinux 253 254 When building kernels, an easy way to 255 syslinux is to use the zdisk or bzdisk 256 and bzimage images respectively. Both 257 FDARGS parameter which can be used to 258 259 e.g:: 260 261 make bzdisk FDARGS="root=/dev/nfs" 262 263 Note that the user running this comman 264 access to the floppy drive device, /de 265 266 For more information on syslinux, incl 267 for prebuilt kernels, see https://sysl 268 269 .. note:: 270 Previously it was possible to 271 a floppy using dd, configure t 272 boot using the resulting flopp 273 method of booting. 274 275 - Booting from a cdrom using isolinux 276 277 When building kernels, an easy way to 278 uses isolinux is to use the isoimage t 279 image. Like zdisk and bzdisk, this tar 280 parameter which can be used to set the 281 282 e.g:: 283 284 make isoimage FDARGS="root=/dev/nfs" 285 286 The resulting iso image will be arch/< 287 This can be written to a cdrom using a 288 cdrecord. 289 290 e.g:: 291 292 cdrecord dev=ATAPI:1,0,0 arch/x86/bo 293 294 For more information on isolinux, incl 295 for prebuilt kernels, see https://sysl 296 297 - Using LILO 298 299 When using LILO all the necessary comm 300 specified using the 'append=' directiv 301 file. 302 303 However, to use the 'root=' directive 304 a dummy root device, which may be remo 305 306 e.g:: 307 308 mknod /dev/boot255 c 0 255 309 310 For information on configuring LILO, p 311 312 - Using GRUB 313 314 When using GRUB, kernel parameter are 315 specification: kernel <kernel> <parame 316 317 - Using loadlin 318 319 loadlin may be used to boot Linux from 320 requiring a local hard disk to mount a 321 thoroughly tested by the authors of th 322 it should be possible configure the ke 323 to the configuration of LILO. 324 325 Please refer to the loadlin documentat 326 327 - Using a boot ROM 328 329 This is probably the most elegant way 330 With a boot ROM the kernel is loaded u 331 authors of this document are not aware 332 ROMs that support booting Linux over t 333 are two free implementations of a boot 334 etherboot, both of which are available 335 of which contain everything you need t 336 337 - Using pxelinux 338 339 Pxelinux may be used to boot linux usi 340 which is present on many modern networ 341 342 When using pxelinux, the kernel image 343 "kernel <relative-path-below /tftpboot 344 are passed to the kernel by adding the 345 It is common to use serial console in 346 see Documentation/admin-guide/serial-c 347 348 For more information on isolinux, incl 349 for prebuilt kernels, see https://sysl 350 351 352 353 354 Credits 355 ======= 356 357 The nfsroot code in the kernel and the RARP 358 by Gero Kuhlmann <gero@gkminix.han.de>. 359 360 The rest of the IP layer autoconfiguration c 361 by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 362 363 In order to write the initial version of nfs 364 Jens-Uwe Mager <jum@anubis.han.de> for his he
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.