Penguin
Annotated edit history of initrd(4) version 4, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
4 CraigBox 2 initrd - boot loader initialized RAM disk
1 perry 3
4 !!DESCRIPTION
4 CraigBox 5 The special file __/dev/initrd __ is a read-only block device. Device __/dev/initrd__ is a RAM disk that is initialized (e.g. loaded) by the boot loader before the [Kernel] is started. The kernel then can use the the block device __/dev/initrd__ 's contents for a two phased system boot-up.
1 perry 6
4 CraigBox 7 In the first boot-up phase, the kernel starts up and mounts an initial root FileSystem from the contents of __/dev/initrd __ (e.g. RAM disk initialized by the BootLoader). In the second phase, additional drivers or other modules are loaded from the initial root device's contents. After loading the additional modules, a new root file system (i.e. the normal root file system) is [Mount]ed from a different device.
1 perry 8
9 !!BOOT-UP OPERATION
4 CraigBox 10 When booting up with __initrd__ , the system boots as follows:
1 perry 11
4 CraigBox 12 # The boot loader loads the kernel program and __/dev/initrd__ 's contents into memory.
13 # On kernel startup, the kernel uncompresses and copies the contents of the device __/dev/initrd__ onto device __/dev/ram0 __ and then frees the memory used by __/dev/initrd__ .
14 # The kernel then read-write mounts device __/dev/ram0 __ as the initial root file system.
15 # If the indicated normal root file system is also the initial root file-system (e.g. __/dev/ram0__ ) then the kernel skips to the last step for the usual boot sequence.
16 # If the executable file __/linuxrc__ is present in the initial root file-system, __/linuxrc__ is executed with uid 0. (The file __/linuxrc__ must have executable permission. The file __/linuxrc__ can be any valid executable, including a shell script.)
17 # If __/linuxrc__ is not executed or when __/linuxrc__ terminates, the normal root file system is mounted. (If __/linuxrc__ exits with any file-systems mounted on the initial root file-system, then the behavior of the kernel is __UNSPECIFIED__ . See the __NOTES__ section for the current kernel behavior.)
18 # If the normal root file has directory __/initrd__ , device __/dev/ram0__ is moved from __/__ to __/initrd__ . Otherwise if directory __/initrd__ does not exist device __/dev/ram0__ is unmounted. (When moved from __/__ to __/initrd__ , __/dev/ram0__ is not unmounted and therefore processes can remain running from __/dev/ram0__ . If directory __/initrd__ does not exist on the normal root file-system and any processes remain running from __/dev/ram0__ when __/linuxrc__ exits, the behavior of the kernel is __UNSPECIFIED__ . See the __NOTES__ section for the current kernel behavior.)
19 # The usual boot sequence (e.g. invocation of __/sbin/init__ ) is performed on the normal root file system.
1 perry 20
21 !!OPTIONS
4 CraigBox 22 The following boot loader options when used with __initrd__ , affect the kernel's boot-up operation:
23 ;__initrd=__ ''filename'' : Specifies the file to load as the contents of __/dev/initrd__ . For __LOADLIN__ this is a command line option. For __LILO__ __you__ have __to__ use __this__ command __in__ the __LILO__ configuration file __/etc/lilo.config__ . The filename specified with this option will typically be a gzipped file-system image.
24 ;__noinitrd__ : This boot time option disables the two phase boot-up operation. The kernel performs the usual boot sequence as if __/dev/initrd __ was not initialized. With this option, any contents of __/dev/initrd __ loaded into memory by the boot loader contents are preserved. This option permits the contents of __/dev/initrd__ to be any data and need not be limited to a file system image. However, device __/dev/initrd __ is read-only and can be read only one time after system startup.
25 ;__root=__ ''device-name'' : Specifies the device to be used as the normal root file system. For __LOADLIN__ this is a command line option. For __LILO__ __this__ is __a__ boot __time__ option __or__ can be used as an option line in the __LILO__ configuration file __/etc/lilo.config__ . The device specified by the this option must be a mountable device having a suitable root file-system.
1 perry 26
27 !!CHANGING THE NORMAL ROOT FILE SYSTEM
4 CraigBox 28 By default, the kernel's settings (e.g. set in the kernel file with __rdev__ or compiled into the kernel file), or the boot loader option setting is used for the normal root file systems. For a NFS-mounted normal root file system, one has to use the __nfs_root_name__ and __nfs_root_addrs__ boot options to give the NFS settings. For more information on NFS-mounted root see the kernel documentation file __nfsroot.txt__ . For more information on setting the root file system also see the __LILO__ and __LOADLIN__ documentation.
1 perry 29
4 CraigBox 30 It is also possible for the __/linuxrc__ executable to change the normal root device. For __/linuxrc__ to change the normal root device, __/proc__ must be mounted. After mounting __/proc__ , __/linuxrc__ changes the normal root device by writing into the proc files __/proc/sys/kernel/real-root-dev__ , __/proc/sys/kernel/nfs-root-name__ , and __/proc/sys/kernel/nfs-root-addrs__ . For a physical root device, the root device is changed by having __/linuxrc__ write the new root file system device number into __/proc/sys/kernel/real-root-dev__ . For a NFS root file system, the root device is changed by having __/linuxrc__ write the NFS setting into files __/proc/sys/kernel/nfs-root-name__ and __/proc/sys/kernel/nfs-root-addrs__ and then writing 0xff (e.g. the pseudo-NFS-device number) into file __/proc/sys/kernel/real-root-dev__ . For example, the following shell command line would change the normal root device to __/dev/hdb1__ :
1 perry 31
4 CraigBox 32 echo 0x365 >/proc/sys/kernel/real-root-dev
1 perry 33
4 CraigBox 34 For a NFS example, the following shell command lines would change the normal root device to the NFS directory __/var/nfsroot__ on a local networked NFS server with IP number 193.8.232.7 for a system with IP number 193.8.232.7 and named 'idefix':
35 echo /var/nfsroot >/proc/sys/kernel/nfs-root-name
36 echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \
37 >/proc/sys/kernel/nfs-root-addrs
38 echo 255 >/proc/sys/kernel/real-root-dev
1 perry 39
40
41
42 !!USAGE
4 CraigBox 43 The main motivation for implementing __initrd__ was to allow for modular kernel configuration at system installation.
1 perry 44
4 CraigBox 45 A possible system installation scenario is as follows:
1 perry 46
4 CraigBox 47 # The loader program boots from floppy or other media with a minimal kernel (e.g. support for __/dev/ram__ , __/dev/initrd__ , and the ext2 file-system) and loads __/dev/initrd__ __with__ a __gzipped__ version __of__ the __initial__ file-system.
48 # The executable __/linuxrc__ determines what is needed to (1) mount the normal root file-system (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach.
49 # The executable __/linuxrc__ loads the necessary modules from the initial root file-system.
50 # The executable __/linuxrc__ creates and populates the root file system. (At this stage the normal root file system does not have to be a completed system yet.)
51 # The executable __/linuxrc__ sets __/proc/sys/kernel/real-root-dev,__ unmount __/proc__ , the normal root file system and any other file systems it has mounted, and then terminates.
52 # The kernel then mounts the normal root file system.
53 # Now that the file system is accessible and intact, the boot loader can be installed.
54 # The boot loader is configured to load into __/dev/initrd__ a file system with the set of modules that was used to bring up the system. (e.g. Device __/dev/ram0__ can be modified, then unmounted, and finally, the image is written from __/dev/ram0__ to a file.)
55 # The system is now bootable and additional installation tasks can be performed.
1 perry 56
57
4 CraigBox 58 The key role of __/dev/initrd__ in the above is to re-use the configuration data during normal system operation without requiring initial kernel selection, a large generic kernel or, recompiling the kernel.
1 perry 59
4 CraigBox 60 A second scenario is for installations where Linux runs on systems with different hardware configurations in a single administrative network. In such cases, it may be desirable to use only a small set of kernels (ideally only one) and to keep the system-specific part of configuration information as small as possible. In this case, create a common file with all needed modules. Then, only the the __/linuxrc__ file or a file executed by __/linuxrc__ would be different.
1 perry 61
4 CraigBox 62 A third scenario is more convenient recovery disks. Because information like the location of the root file-system partition is not needed at boot time, the system loaded from __/dev/initrd __ can use a dialog and/or auto-detection followed by a possible sanity check.
1 perry 63
4 CraigBox 64 Last but not least, Linux distributions on CD-ROM may use __initrd__ for easy installation from the CD-ROM. The distribution can use __LOADLIN__ to directly load __/dev/initrd__ from CD-ROM without the need of any floppies. The distribution could also use a __LILO__ boot floppy and then bootstrap a bigger ram disk via __/dev/initrd__ from the CD-ROM.
1 perry 65
66 !!CONFIGURATION
4 CraigBox 67 The __/dev/initrd __ is a read-only block device assigned major number 1 and minor number 250. Typically __/dev/initrd__ is owned by __root.disk __ with mode 0400 (read access by root only). If the Linux system does not have __/dev/initrd__ already created, it can be created with the following commands:
68 __
1 perry 69
4 CraigBox 70 mknod -m 400 /dev/initrd b 1 250
1 perry 71
4 CraigBox 72 chown root:disk /dev/initrd
1 perry 73
4 CraigBox 74 Also, support for both "RAM disk" and "Initial RAM disk" (e.g. __CONFIG_BLK_DEV_RAM=y__ and __CONFIG_BLK_DEV_INITRD=y__ ) support must be compiled directly into the Linux kernel to use __/dev/initrd__ . When using __/dev/initrd__ , the RAM disk driver cannot be loaded as a module.
1 perry 75
76 !!FILES
4 CraigBox 77 ''/dev/initrd''
78 ''/dev/ram0''
79 ''/linuxrc''
80 ''/initrd''
1 perry 81
82 !!SEE ALSO
4 CraigBox 83 chown(1), mknod(1), __/dev/ram__ (4), freeramdisk(8), rdev(8), The documentation file ''initrd.txt'' in the kernel source package, the LILO documentation, the LOADLIN documentation, the SYSLINUX documentation.
1 perry 84
85 !!NOTES
4 CraigBox 86 1. With the current kernel, any file systems that remain mounted when __/dev/ram0__ is moved from __/__ to __/initrd__ continue to be accessible. However, the __/proc/mounts__ entries are not updated.
1 perry 87
4 CraigBox 88 2. With the current kernel, if directory __/initrd__ does not exist, then __/dev/ram0__ will NOT be fully unmounted if __/dev/ram0__ is used by any process or has any file-system mounted on it. If __/dev/ram0__ is NOT fully unmounted, then __/dev/ram0__ will remain in memory.
1 perry 89
4 CraigBox 90 3. Users of __/dev/initrd__ should not depend on the behavior give in the above notes. The behavior may change in future versions of the Linux kernel.
1 perry 91
92 !!AUTHOR
4 CraigBox 93 The kernel code for device __initrd__ was written by Werner Almesberger <almesber@lrc.epfl.ch> and Hans Lermen <lermen@elserv.ffm.fgan.de>. The code for __initrd__ was added to the baseline Linux kernel in development version 1.3.73.
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 13 times)