1 .\" This man-page is Copyright (C) 1997 John S. Kallal
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" If the you wish to distribute versions of this work under other
6 .\" conditions than the above, please contact the author(s) at the following
10 .\" email: <kallal@voicenet.com>
11 .\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA
12 .\" phone: (302)654-5478
14 .\" $Id: initrd.4,v 0.9 1997/11/07 05:05:32 kallal Exp kallal $
15 .TH initrd 4 (date) "Linux man-pages (unreleased)"
17 initrd \- boot loader initialized RAM disk
20 is a read-only block device assigned
21 major number 1 and minor number 250.
26 with mode 0400 (read access by root only).
27 If the Linux system does not have
29 already created, it can be created with the following commands:
33 mknod \-m 400 /dev/initrd b 1 250
34 chown root:disk /dev/initrd
38 Also, support for both "RAM disk" and "Initial RAM disk"
40 .B CONFIG_BLK_DEV_RAM=y
42 .BR CONFIG_BLK_DEV_INITRD=y )
43 must be compiled directly into the Linux kernel to use
47 the RAM disk driver cannot be loaded as a module.
54 is a read-only block device.
55 This device is a RAM disk that is initialized (e.g., loaded)
56 by the boot loader before the kernel is started.
57 The kernel then can use
59 contents for a two-phase system boot-up.
61 In the first boot-up phase, the kernel starts up
62 and mounts an initial root filesystem from the contents of
64 (e.g., RAM disk initialized by the boot loader).
65 In the second phase, additional drivers or other modules
66 are loaded from the initial root device's contents.
67 After loading the additional modules, a new root filesystem
68 (i.e., the normal root filesystem) is mounted from a
76 the system boots as follows:
78 The boot loader loads the kernel program and
83 the kernel uncompresses and copies the contents of the device
87 and then frees the memory used by
90 The kernel then read-write mounts the device
92 as the initial root filesystem.
94 If the indicated normal root filesystem is also the initial
95 root filesystem (e.g.,
97 then the kernel skips to the last step for the usual boot sequence.
99 If the executable file
101 is present in the initial root filesystem,
103 is executed with UID 0.
106 must have executable permission.
109 can be any valid executable, including a shell script.)
113 is not executed or when
115 terminates, the normal root filesystem is mounted.
118 exits with any filesystems mounted on the initial root
119 filesystem, then the behavior of the kernel is
121 See the NOTES section for the current kernel behavior.)
123 If the normal root filesystem has a directory
131 Otherwise, if the directory
133 does not exist, the device
141 is not unmounted and therefore processes can remain running from
145 does not exist on the normal root filesystem
146 and any processes remain running from
150 exits, the behavior of the kernel is
152 See the NOTES section for the current kernel behavior.)
154 The usual boot sequence (e.g., invocation of
156 is performed on the normal root filesystem.
161 The following boot loader options, when used with
163 affect the kernel's boot-up operation:
165 .BI initrd= "filename"
166 Specifies the file to load as the contents of
170 this is a command-line option.
173 you have to use this command in the
176 .IR /etc/lilo.config .
177 The filename specified with this
178 option will typically be a gzipped filesystem image.
181 This boot option disables the two-phase boot-up operation.
182 The kernel performs the usual boot sequence as if
185 With this option, any contents of
187 loaded into memory by the boot loader contents are preserved.
188 This option permits the contents of
190 to be any data and need not be limited to a filesystem image.
193 is read-only and can be read only one time after system startup.
195 .BI root= "device-name"
196 Specifies the device to be used as the normal root filesystem.
199 this is a command-line option.
202 this is a boot time option or
203 can be used as an option line in the
206 .IR /etc/lilo.config .
207 The device specified by this option must be a mountable
208 device having a suitable root filesystem.
212 .SS Changing the normal root filesystem
214 the kernel's settings
215 (e.g., set in the kernel file with
217 or compiled into the kernel file),
218 or the boot loader option setting
219 is used for the normal root filesystems.
220 For an NFS-mounted normal root filesystem, one has to use the
224 boot options to give the NFS settings.
225 For more information on NFS-mounted root see the kernel documentation file
226 .I Documentation/filesystems/nfs/nfsroot.txt
227 .\" commit dc7a08166f3a5f23e79e839a8a88849bd3397c32
229 .I Documentation/filesystems/nfsroot.txt
230 before Linux 2.6.33).
231 For more information on setting the root filesystem see also the
237 It is also possible for the
239 executable to change the normal root device.
242 to change the normal root device,
248 changes the normal root device by writing into the proc files
249 .IR /proc/sys/kernel/real\-root\-dev ,
250 .IR /proc/sys/kernel/nfs\-root\-name ,
252 .IR /proc/sys/kernel/nfs\-root\-addrs .
253 For a physical root device, the root device is changed by having
255 write the new root filesystem device number into
256 .IR /proc/sys/kernel/real\-root\-dev .
257 For an NFS root filesystem, the root device is changed by having
259 write the NFS setting into files
260 .I /proc/sys/kernel/nfs\-root\-name
262 .I /proc/sys/kernel/nfs\-root\-addrs
263 and then writing 0xff (e.g., the pseudo-NFS-device number) into file
264 .IR /proc/sys/kernel/real\-root\-dev .
265 For example, the following shell command line would change
266 the normal root device to
271 echo 0x365 >/proc/sys/kernel/real\-root\-dev
275 For an NFS example, the following shell command lines would change the
276 normal root device to the NFS directory
278 on a local networked NFS server with IP number 193.8.232.7 for a system with
279 IP number 193.8.232.2 and named "idefix":
283 echo /var/nfsroot >/proc/sys/kernel/nfs\-root\-name
284 echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \e
285 >/proc/sys/kernel/nfs\-root\-addrs
286 echo 255 >/proc/sys/kernel/real\-root\-dev
292 .I /proc/sys/kernel/real\-root\-dev
293 to change the root filesystem is obsolete.
294 See the Linux kernel source file
295 .I Documentation/admin\-guide/initrd.rst
296 .\" commit 9d85025b0418163fae079c9ba8f8445212de8568
298 .I Documentation/initrd.txt
304 for information on the modern method of changing the root filesystem.
305 .\" FIXME . Should this manual page describe the pivot_root mechanism?
310 The main motivation for implementing
312 was to allow for modular kernel configuration at system installation.
314 A possible system installation scenario is as follows:
316 The loader program boots from floppy or other media with a minimal kernel
320 and the ext2 filesystem) and loads
322 with a gzipped version of the initial filesystem.
326 determines what is needed to (1) mount the normal root filesystem
327 (i.e., device type, device drivers, filesystem) and (2) the
328 distribution media (e.g., CD-ROM, network, tape, ...).
329 This can be done by asking the user, by auto-probing,
330 or by using a hybrid approach.
334 loads the necessary modules from the initial root filesystem.
338 creates and populates the root filesystem.
339 (At this stage the normal root filesystem does not have to be a
340 completed system yet.)
345 .IR /proc/sys/kernel/real\-root\-dev ,
348 the normal root filesystem and any other filesystems
349 it has mounted, and then terminates.
351 The kernel then mounts the normal root filesystem.
353 Now that the filesystem is accessible and intact,
354 the boot loader can be installed.
356 The boot loader is configured to load into
358 a filesystem with the set of modules that was used to bring up the system.
361 can be modified, then unmounted, and finally, the image is written from
365 The system is now bootable and additional installation tasks can be
370 in the above is to reuse the configuration data during normal system operation
371 without requiring initial kernel selection, a large generic kernel or,
372 recompiling the kernel.
374 A second scenario is for installations where Linux runs on systems with
375 different hardware configurations in a single administrative network.
376 In such cases, it may be desirable to use only a small set of kernels
377 (ideally only one) and to keep the system-specific part of configuration
378 information as small as possible.
379 In this case, create a common file
380 with all needed modules.
383 file or a file executed by
387 A third scenario is more convenient recovery disks.
388 Because information like the location of the root filesystem
389 partition is not needed at boot time, the system loaded from
391 can use a dialog and/or auto-detection followed by a
392 possible sanity check.
394 Last but not least, Linux distributions on CD-ROM may use
396 for easy installation from the CD-ROM.
397 The distribution can use
401 from CD-ROM without the need of any floppies.
402 The distribution could also use a
404 boot floppy and then bootstrap a bigger RAM disk via
423 With the current kernel, any filesystems that remain mounted when
429 continue to be accessible.
432 entries are not updated.
434 With the current kernel, if directory
440 be fully unmounted if
442 is used by any process or has any filesystem mounted on it.
447 fully unmounted, then
449 will remain in memory.
453 should not depend on the behavior given in the above notes.
454 The behavior may change in future versions of the Linux kernel.
459 .\" The kernel code for device
461 .\" was written by Werner Almesberger <almesber@lrc.epfl.ch> and
462 .\" Hans Lermen <lermen@elserv.ffm.fgan.de>.
465 .\" was added to the baseline Linux kernel in development version 1.3.73.
473 .I Documentation/admin\-guide/initrd.rst
474 .\" commit 9d85025b0418163fae079c9ba8f8445212de8568
476 .I Documentation/initrd.txt
478 in the Linux kernel source tree, the LILO documentation,
479 the LOADLIN documentation, the SYSLINUX documentation