1 .\" This man-page is Copyright (C) 1997 John S. Kallal
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and author(s) of this work.
25 .\" If the you wish to distribute versions of this work under other
26 .\" conditions than the above, please contact the author(s) at the following
30 .\" email: <kallal@voicenet.com>
31 .\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA
32 .\" phone: (302)654-5478
34 .\" $Id: initrd.4,v 0.9 1997/11/07 05:05:32 kallal Exp kallal $
35 .TH INITRD 4 2010-09-04 "Linux" "Linux Programmer's Manual"
37 initrd \- boot loader initialized RAM disk
41 is a read-only block device assigned
42 major number 1 and minor number 250.
47 with mode 0400 (read access by root only).
48 If the Linux system does not have
50 already created, it can be created with the following commands:
53 mknod \-m 400 /dev/initrd b 1 250
54 chown root:disk /dev/initrd
58 Also, support for both "RAM disk" and "Initial RAM disk"
60 .BR CONFIG_BLK_DEV_RAM=y
62 .BR CONFIG_BLK_DEV_INITRD=y )
63 must be compiled directly into the Linux kernel to use
67 the RAM disk driver cannot be loaded as a module.
74 is a read-only block device.
75 This device is a RAM disk that is initialized (e.g., loaded)
76 by the boot loader before the kernel is started.
77 The kernel then can use
79 contents for a two-phase system boot-up.
81 In the first boot-up phase, the kernel starts up
82 and mounts an initial root filesystem from the contents of
84 (e.g., RAM disk initialized by the boot loader).
85 In the second phase, additional drivers or other modules
86 are loaded from the initial root device's contents.
87 After loading the additional modules, a new root filesystem
88 (i.e., the normal root filesystem) is mounted from a
96 the system boots as follows:
98 The boot loader loads the kernel program and
100 contents into memory.
103 the kernel uncompresses and copies the contents of the device
107 and then frees the memory used by
110 The kernel then read-write mounts the device
112 as the initial root filesystem.
114 If the indicated normal root filesystem is also the initial
115 root filesystem (e.g.,
117 then the kernel skips to the last step for the usual boot sequence.
119 If the executable file
121 is present in the initial root filesystem,
123 is executed with UID 0.
126 must have executable permission.
129 can be any valid executable, including a shell script.)
133 is not executed or when
135 terminates, the normal root filesystem is mounted.
138 exits with any filesystems mounted on the initial root
139 filesystem, then the behavior of the kernel is
141 See the NOTES section for the current kernel behavior.)
143 If the normal root filesystem has a directory
151 Otherwise, if the directory
153 does not exist, the device
161 is not unmounted and therefore processes can remain running from
165 does not exist on the normal root filesystem
166 and any processes remain running from
170 exits, the behavior of the kernel is
172 See the NOTES section for the current kernel behavior.)
174 The usual boot sequence (e.g., invocation of
176 is performed on the normal root filesystem.
181 The following boot loader options, when used with
183 affect the kernel's boot-up operation:
185 .BI initrd= "filename"
186 Specifies the file to load as the contents of
190 this is a command-line option.
193 you have to use this command in the
196 .IR /etc/lilo.config .
197 The filename specified with this
198 option will typically be a gzipped filesystem image.
201 This boot option disables the two-phase boot-up operation.
202 The kernel performs the usual boot sequence as if
205 With this option, any contents of
207 loaded into memory by the boot loader contents are preserved.
208 This option permits the contents of
210 to be any data and need not be limited to a filesystem image.
213 is read-only and can be read only one time after system startup.
215 .BI root= "device-name"
216 Specifies the device to be used as the normal root filesystem.
219 this is a command-line option.
222 this is a boot time option or
223 can be used as an option line in the
226 .IR /etc/lilo.config .
227 The device specified by the this option must be a mountable
228 device having a suitable root filesystem.
232 .SS Changing the normal root filesystem
234 the kernel's settings
235 (e.g., set in the kernel file with
237 or compiled into the kernel file),
238 or the boot loader option setting
239 is used for the normal root filesystems.
240 For an NFS-mounted normal root filesystem, one has to use the
244 boot options to give the NFS settings.
245 For more information on NFS-mounted root see the kernel documentation file
246 .BR Documentation/filesystems/nfsroot.txt .
247 For more information on setting the root filesystem see also the
253 It is also possible for the
255 executable to change the normal root device.
258 to change the normal root device,
264 changes the normal root device by writing into the proc files
265 .IR /proc/sys/kernel/real-root-dev ,
266 .IR /proc/sys/kernel/nfs-root-name ,
268 .IR /proc/sys/kernel/nfs-root-addrs .
269 For a physical root device, the root device is changed by having
271 write the new root filesystem device number into
272 .IR /proc/sys/kernel/real-root-dev .
273 For an NFS root filesystem, the root device is changed by having
275 write the NFS setting into files
276 .IR /proc/sys/kernel/nfs-root-name
278 .I /proc/sys/kernel/nfs-root-addrs
279 and then writing 0xff (e.g., the pseudo-NFS-device number) into file
280 .IR /proc/sys/kernel/real-root-dev .
281 For example, the following shell command line would change
282 the normal root device to
286 echo 0x365 >/proc/sys/kernel/real-root-dev
289 For an NFS example, the following shell command lines would change the
290 normal root device to the NFS directory
292 on a local networked NFS server with IP number 193.8.232.7 for a system with
293 IP number 193.8.232.2 and named "idefix":
296 echo /var/nfsroot >/proc/sys/kernel/nfs-root-name
297 echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\
298 >/proc/sys/kernel/nfs-root-addrs
299 echo 255 >/proc/sys/kernel/real-root-dev
304 .I /proc/sys/kernel/real-root-dev
305 to change the root filesystem is obsolete.
306 See the Linux kernel source file
307 .I Documentation/initrd.txt
312 for information on the modern method of changing the root filesystem.
313 .\" FIXME . Should this manual page describe the pivot_root mechanism?
318 The main motivation for implementing
320 was to allow for modular kernel configuration at system installation.
322 A possible system installation scenario is as follows:
324 The loader program boots from floppy or other media with a minimal kernel
328 and the ext2 filesystem) and loads
330 with a gzipped version of the initial filesystem.
334 determines what is needed to (1) mount the normal root filesystem
335 (i.e., device type, device drivers, filesystem) and (2) the
336 distribution media (e.g., CD-ROM, network, tape, ...).
337 This can be done by asking the user, by auto-probing,
338 or by using a hybrid approach.
342 loads the necessary modules from the initial root filesystem.
346 creates and populates the root filesystem.
347 (At this stage the normal root filesystem does not have to be a
348 completed system yet.)
353 .IR /proc/sys/kernel/real-root-dev ,
356 the normal root filesystem and any other filesystems
357 it has mounted, and then terminates.
359 The kernel then mounts the normal root filesystem.
361 Now that the filesystem is accessible and intact,
362 the boot loader can be installed.
364 The boot loader is configured to load into
366 a filesystem with the set of modules that was used to bring up the system.
369 can be modified, then unmounted, and finally, the image is written from
373 The system is now bootable and additional installation tasks can be
378 in the above is to reuse the configuration data during normal system operation
379 without requiring initial kernel selection, a large generic kernel or,
380 recompiling the kernel.
382 A second scenario is for installations where Linux runs on systems with
383 different hardware configurations in a single administrative network.
384 In such cases, it may be desirable to use only a small set of kernels
385 (ideally only one) and to keep the system-specific part of configuration
386 information as small as possible.
387 In this case, create a common file
388 with all needed modules.
391 file or a file executed by
395 A third scenario is more convenient recovery disks.
396 Because information like the location of the root filesystem
397 partition is not needed at boot time, the system loaded from
399 can use a dialog and/or auto-detection followed by a
400 possible sanity check.
402 Last but not least, Linux distributions on CD-ROM may use
404 for easy installation from the CD-ROM.
405 The distribution can use
409 from CD-ROM without the need of any floppies.
410 The distribution could also use a
412 boot floppy and then bootstrap a bigger RAM disk via
431 With the current kernel, any filesystems that remain mounted when
437 continue to be accessible.
440 entries are not updated.
442 With the current kernel, if directory
448 be fully unmounted if
450 is used by any process or has any filesystem mounted on it.
455 fully unmounted, then
457 will remain in memory.
461 should not depend on the behavior give in the above notes.
462 The behavior may change in future versions of the Linux kernel.
467 .\" The kernel code for device
469 .\" was written by Werner Almesberger <almesber@lrc.epfl.ch> and
470 .\" Hans Lermen <lermen@elserv.ffm.fgan.de>.
473 .\" was added to the baseline Linux kernel in development version 1.3.73.
481 .I Documentation/initrd.txt
482 in the Linux kernel source tree, the LILO documentation,
483 the LOADLIN documentation, the SYSLINUX documentation