2007-04-12 22:42:49 +00:00
|
|
|
.\" -*- nroff -*-
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" This man-page is Copyright (C) 1997 John S. Kallal
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and author(s) of this work.
|
|
|
|
.\"
|
|
|
|
.\" If the you wish to distribute versions of this work under other
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" conditions than the above, please contact the author(s) at the following
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" for permission:
|
2007-06-21 22:55:04 +00:00
|
|
|
.\"
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" John S. Kallal -
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" email: <kallal@voicenet.com>
|
|
|
|
.\" mail: 518 Kerfoot Farm RD, Wilmington, DE 19803-2444, USA
|
|
|
|
.\" phone: (302)654-5478
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" $Id: initrd.4,v 0.9 1997/11/07 05:05:32 kallal Exp kallal $
|
2010-09-04 05:19:26 +00:00
|
|
|
.TH INITRD 4 2010-09-04 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
initrd \- boot loader initialized RAM disk
|
2007-11-23 07:41:09 +00:00
|
|
|
.SH CONFIGURATION
|
|
|
|
The
|
|
|
|
.I /dev/initrd
|
|
|
|
is a read-only block device assigned
|
|
|
|
major number 1 and minor number 250.
|
|
|
|
Typically
|
|
|
|
.I /dev/initrd
|
|
|
|
is owned by
|
|
|
|
.I root.disk
|
|
|
|
with mode 0400 (read access by root only).
|
|
|
|
If the Linux system does not have
|
|
|
|
.I /dev/initrd
|
|
|
|
already created, it can be created with the following commands:
|
|
|
|
.nf
|
|
|
|
\fB
|
|
|
|
mknod \-m 400 /dev/initrd b 1 250
|
|
|
|
chown root:disk /dev/initrd
|
|
|
|
\fP
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
Also, support for both "RAM disk" and "Initial RAM disk"
|
|
|
|
(e.g.
|
2008-01-12 09:33:09 +00:00
|
|
|
.BR CONFIG_BLK_DEV_RAM=y
|
2008-01-12 08:55:00 +00:00
|
|
|
and
|
|
|
|
.BR CONFIG_BLK_DEV_INITRD=y )
|
2007-11-23 07:41:09 +00:00
|
|
|
must be compiled directly into the Linux kernel to use
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd .
|
2007-11-23 07:41:09 +00:00
|
|
|
When using
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd ,
|
2007-11-23 07:41:09 +00:00
|
|
|
the RAM disk driver cannot be loaded as a module.
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2007-04-12 22:42:49 +00:00
|
|
|
The special file
|
|
|
|
.I /dev/initrd
|
|
|
|
is a read-only block device.
|
2009-04-03 18:00:03 +00:00
|
|
|
This device is a RAM disk that is initialized (e.g., loaded)
|
|
|
|
by the boot loader before the kernel is started.
|
|
|
|
The kernel then can use
|
2007-04-12 22:42:49 +00:00
|
|
|
.IR /dev/initrd "'s "
|
2009-04-03 18:00:03 +00:00
|
|
|
contents for a two-phase system boot-up.
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
In the first boot-up phase, the kernel starts up
|
2009-04-03 18:00:03 +00:00
|
|
|
and mounts an initial root file-system from the contents of
|
2007-04-12 22:42:49 +00:00
|
|
|
.I /dev/initrd
|
2008-09-10 03:38:18 +00:00
|
|
|
(e.g., RAM disk initialized by the boot loader).
|
2007-04-12 22:42:49 +00:00
|
|
|
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
|
2007-06-08 11:56:22 +00:00
|
|
|
(i.e., the normal root file system) is mounted from a
|
2004-11-03 13:51:07 +00:00
|
|
|
different device.
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2007-06-15 19:32:07 +00:00
|
|
|
.SS "Boot-up Operation"
|
2007-04-12 22:42:49 +00:00
|
|
|
When booting up with
|
2008-01-12 08:55:00 +00:00
|
|
|
.BR initrd ,
|
|
|
|
the system boots as follows:
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 1. 3
|
|
|
|
The boot loader loads the kernel program and
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd 's
|
|
|
|
contents into memory.
|
2007-11-17 06:13:58 +00:00
|
|
|
.IP 2.
|
2007-06-15 19:32:07 +00:00
|
|
|
On kernel startup,
|
2007-04-12 22:42:49 +00:00
|
|
|
the kernel uncompresses and copies the contents of the device
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /dev/initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
onto device
|
|
|
|
.I /dev/ram0
|
|
|
|
and then frees the memory used by
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd .
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 3.
|
2009-04-03 18:00:03 +00:00
|
|
|
The kernel then read-write mounts the device
|
2007-04-12 22:42:49 +00:00
|
|
|
.I /dev/ram0
|
2004-11-03 13:51:07 +00:00
|
|
|
as the initial root file system.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 4.
|
2009-04-03 18:00:03 +00:00
|
|
|
If the indicated normal root file system is also the initial
|
|
|
|
root file-system (e.g.
|
|
|
|
.IR /dev/ram0 )
|
|
|
|
then the kernel skips to the last step for the usual boot sequence.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 5.
|
|
|
|
If the executable file
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /linuxrc
|
|
|
|
is present in the initial root file-system,
|
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
is executed with UID 0.
|
|
|
|
(The file
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
must have executable permission.
|
|
|
|
The file
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
can be any valid executable, including a shell script.)
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 6.
|
|
|
|
If
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
is not executed or when
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
terminates, the normal root file system is mounted.
|
2004-11-03 13:51:07 +00:00
|
|
|
(If
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
exits with any file-systems mounted on the initial root
|
|
|
|
file-system, then the behavior of the kernel is
|
2008-01-12 08:55:00 +00:00
|
|
|
.BR UNSPECIFIED .
|
2007-12-10 06:42:35 +00:00
|
|
|
See the NOTES section for the current kernel behavior.)
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 7.
|
2009-04-03 18:00:03 +00:00
|
|
|
If the normal root file system has a directory
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /initrd ,
|
2009-04-03 18:00:03 +00:00
|
|
|
the device
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /dev/ram0
|
2007-04-12 22:42:49 +00:00
|
|
|
is moved from
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /
|
|
|
|
to
|
|
|
|
.IR /initrd .
|
2009-04-03 18:00:03 +00:00
|
|
|
Otherwise if the directory
|
2008-01-12 09:33:09 +00:00
|
|
|
.IR /initrd
|
2009-04-03 18:00:03 +00:00
|
|
|
does not exist, the device
|
2008-01-12 08:55:00 +00:00
|
|
|
.I /dev/ram0
|
|
|
|
is unmounted.
|
2007-04-12 22:42:49 +00:00
|
|
|
(When moved from
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /
|
2008-01-12 09:33:09 +00:00
|
|
|
to
|
|
|
|
.IR /initrd ,
|
2008-01-12 08:55:00 +00:00
|
|
|
.I /dev/ram0
|
2007-04-12 22:42:49 +00:00
|
|
|
is not unmounted and therefore processes can remain running from
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/ram0 .
|
2007-04-12 22:42:49 +00:00
|
|
|
If directory
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /initrd
|
2009-04-03 18:00:03 +00:00
|
|
|
does not exist on the normal root file system
|
2007-04-12 22:42:49 +00:00
|
|
|
and any processes remain running from
|
2008-01-12 09:33:09 +00:00
|
|
|
.IR /dev/ram0
|
2008-01-12 08:55:00 +00:00
|
|
|
when
|
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
exits, the behavior of the kernel is
|
2008-01-12 08:55:00 +00:00
|
|
|
.BR UNSPECIFIED .
|
2007-12-10 06:42:35 +00:00
|
|
|
See the NOTES section for the current kernel behavior.)
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 8.
|
2008-09-10 03:40:20 +00:00
|
|
|
The usual boot sequence (e.g., invocation of
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /sbin/init )
|
|
|
|
is performed on the normal root file system.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2007-06-15 19:32:07 +00:00
|
|
|
.SS Options
|
2009-04-03 18:00:03 +00:00
|
|
|
The following boot loader options, when used with
|
2008-01-12 08:55:00 +00:00
|
|
|
.BR initrd ,
|
|
|
|
affect the kernel's boot-up operation:
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.BI initrd= "filename"
|
2007-04-12 22:42:49 +00:00
|
|
|
Specifies the file to load as the contents of
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd .
|
2006-05-31 22:16:55 +00:00
|
|
|
For
|
2007-04-12 22:42:49 +00:00
|
|
|
.B LOADLIN
|
2008-03-19 08:37:35 +00:00
|
|
|
this is a command-line option.
|
2007-04-12 22:42:49 +00:00
|
|
|
For
|
|
|
|
.B LILO
|
|
|
|
you have to use this command in the
|
|
|
|
.B LILO
|
|
|
|
configuration file
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /etc/lilo.config .
|
2004-11-03 13:51:07 +00:00
|
|
|
The filename specified with this
|
|
|
|
option will typically be a gzipped file-system image.
|
|
|
|
.TP
|
2005-11-02 13:55:25 +00:00
|
|
|
.I noinitrd
|
2009-04-03 18:00:03 +00:00
|
|
|
This boot option disables the two-phase boot-up operation.
|
2007-04-12 22:42:49 +00:00
|
|
|
The kernel performs the usual boot sequence as if
|
|
|
|
.I /dev/initrd
|
|
|
|
was not initialized.
|
2004-11-03 13:51:07 +00:00
|
|
|
With this option, any contents of
|
2007-04-12 22:42:49 +00:00
|
|
|
.I /dev/initrd
|
2004-11-03 13:51:07 +00:00
|
|
|
loaded into memory by the boot loader contents are preserved.
|
2007-04-12 22:42:49 +00:00
|
|
|
This option permits the contents of
|
|
|
|
.I /dev/initrd
|
|
|
|
to be any data and need not be limited to a file system image.
|
|
|
|
However, device
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /dev/initrd
|
2004-11-03 13:51:07 +00:00
|
|
|
is read-only and can be read only one time after system startup.
|
|
|
|
.TP
|
|
|
|
.BI root= "device-name"
|
2007-04-12 22:42:49 +00:00
|
|
|
Specifies the device to be used as the normal root file system.
|
2008-01-12 08:55:00 +00:00
|
|
|
For
|
|
|
|
.B LOADLIN
|
2008-03-19 08:37:35 +00:00
|
|
|
this is a command-line option.
|
2008-01-12 08:55:00 +00:00
|
|
|
For
|
|
|
|
.B LILO
|
|
|
|
this is a boot time option or
|
2007-04-12 22:42:49 +00:00
|
|
|
can be used as an option line in the
|
2008-01-12 08:55:00 +00:00
|
|
|
.B LILO
|
2008-01-12 09:33:09 +00:00
|
|
|
configuration file
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /etc/lilo.config .
|
2007-04-12 22:42:49 +00:00
|
|
|
The device specified by the this option must be a mountable
|
2004-11-03 13:51:07 +00:00
|
|
|
device having a suitable root file-system.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2007-06-15 19:32:07 +00:00
|
|
|
.SS "Changing the Normal Root File System"
|
2007-04-12 22:42:49 +00:00
|
|
|
By default,
|
2004-11-03 13:51:07 +00:00
|
|
|
the kernel's settings
|
2008-09-10 03:40:20 +00:00
|
|
|
(e.g., set in the kernel file with
|
2005-11-02 13:55:25 +00:00
|
|
|
.BR rdev (8)
|
2004-11-03 13:51:07 +00:00
|
|
|
or compiled into the kernel file),
|
|
|
|
or the boot loader option setting
|
|
|
|
is used for the normal root file systems.
|
2009-04-03 18:00:03 +00:00
|
|
|
For an NFS-mounted normal root file system, one has to use the
|
2008-01-12 09:33:09 +00:00
|
|
|
.B nfs_root_name
|
2008-01-12 08:55:00 +00:00
|
|
|
and
|
|
|
|
.B nfs_root_addrs
|
2007-04-12 22:42:49 +00:00
|
|
|
boot options to give the NFS settings.
|
2004-11-03 13:51:07 +00:00
|
|
|
For more information on NFS-mounted root see the kernel documentation file
|
2009-04-03 18:00:03 +00:00
|
|
|
.BR Documentation/filesystems/nfsroot.txt .
|
|
|
|
For more information on setting the root file system see also the
|
2008-01-12 08:55:00 +00:00
|
|
|
.BR LILO
|
|
|
|
and
|
2010-08-29 04:54:31 +00:00
|
|
|
.BR LOADLIN
|
2008-01-12 08:55:00 +00:00
|
|
|
documentation.
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
It is also possible for the
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
executable to change the normal root device.
|
2007-04-12 22:42:49 +00:00
|
|
|
For
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
to change the normal root device,
|
2008-01-12 09:33:09 +00:00
|
|
|
.IR /proc
|
2008-01-12 08:55:00 +00:00
|
|
|
must be mounted.
|
2007-04-12 22:42:49 +00:00
|
|
|
After mounting
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc ,
|
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
changes the normal root device by writing into the proc files
|
2008-01-12 09:33:09 +00:00
|
|
|
.IR /proc/sys/kernel/real-root-dev ,
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc/sys/kernel/nfs-root-name ,
|
|
|
|
and
|
|
|
|
.IR /proc/sys/kernel/nfs-root-addrs .
|
2004-11-03 13:51:07 +00:00
|
|
|
For a physical root device, the root device is changed by having
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
write the new root file system device number into
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc/sys/kernel/real-root-dev .
|
2009-04-03 18:00:03 +00:00
|
|
|
For an NFS root file system, the root device is changed by having
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
write the NFS setting into files
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc/sys/kernel/nfs-root-name
|
|
|
|
and
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /proc/sys/kernel/nfs-root-addrs
|
2008-09-10 03:40:20 +00:00
|
|
|
and then writing 0xff (e.g., the pseudo-NFS-device number) into file
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc/sys/kernel/real-root-dev .
|
2004-11-03 13:51:07 +00:00
|
|
|
For example, the following shell command line would change
|
2007-04-12 22:42:49 +00:00
|
|
|
the normal root device to
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /dev/hdb1 :
|
2004-11-03 13:51:07 +00:00
|
|
|
.nf
|
2007-04-05 13:29:41 +00:00
|
|
|
|
|
|
|
echo 0x365 >/proc/sys/kernel/real-root-dev
|
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
2009-04-03 18:00:03 +00:00
|
|
|
For an NFS example, the following shell command lines would change the
|
2007-04-12 22:42:49 +00:00
|
|
|
normal root device to the NFS directory
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /var/nfsroot
|
2007-04-12 22:42:49 +00:00
|
|
|
on a local networked NFS server with IP number 193.8.232.7 for a system with
|
2010-08-29 04:57:24 +00:00
|
|
|
IP number 193.8.232.2 and named "idefix":
|
2004-11-03 13:51:07 +00:00
|
|
|
.nf
|
2007-04-05 13:29:41 +00:00
|
|
|
|
|
|
|
echo /var/nfsroot >/proc/sys/kernel/nfs-root-name
|
|
|
|
echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix \\
|
|
|
|
>/proc/sys/kernel/nfs-root-addrs
|
|
|
|
echo 255 >/proc/sys/kernel/real-root-dev
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
2005-09-21 12:40:22 +00:00
|
|
|
|
|
|
|
.BR Note :
|
|
|
|
The use of
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /proc/sys/kernel/real-root-dev
|
2005-09-21 12:40:22 +00:00
|
|
|
to change the root file system is obsolete.
|
|
|
|
See the kernel source file
|
|
|
|
.I Documentation/initrd.txt
|
|
|
|
as well as
|
|
|
|
.BR pivot_root (2)
|
|
|
|
and
|
|
|
|
.BR pivot_root (8)
|
2007-04-12 22:42:49 +00:00
|
|
|
for information on the modern method of changing the root file system.
|
2005-09-21 12:40:22 +00:00
|
|
|
.\" FIXME the manual page should describe the pivot_root mechanism.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2007-06-15 19:32:07 +00:00
|
|
|
.SS Usage
|
2007-04-12 22:42:49 +00:00
|
|
|
The main motivation for implementing
|
2007-09-20 16:26:31 +00:00
|
|
|
.B initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
was to allow for modular kernel configuration at system installation.
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
|
|
|
A possible system installation scenario is as follows:
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 1. 3
|
|
|
|
The loader program boots from floppy or other media with a minimal kernel
|
2008-09-10 03:40:20 +00:00
|
|
|
(e.g., support for
|
2008-01-12 09:33:09 +00:00
|
|
|
.IR /dev/ram ,
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd ,
|
|
|
|
and the ext2 file-system) and loads
|
|
|
|
.IR /dev/initrd
|
|
|
|
with a gzipped version of the initial file-system.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 2.
|
|
|
|
The executable
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
determines what is needed to (1) mount the normal root file-system
|
2007-06-08 11:56:22 +00:00
|
|
|
(i.e., device type, device drivers, file system) and (2) the
|
2008-09-10 03:40:20 +00:00
|
|
|
distribution media (e.g., CD-ROM, network, tape, ...).
|
2009-04-03 18:00:03 +00:00
|
|
|
This can be done by asking the user, by auto-probing,
|
|
|
|
or by using a hybrid approach.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 3.
|
|
|
|
The executable
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
loads the necessary modules from the initial root file-system.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 4.
|
|
|
|
The executable
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /linuxrc
|
2007-04-12 22:42:49 +00:00
|
|
|
creates and populates the root file system.
|
|
|
|
(At this stage the normal root file system does not have to be a
|
2004-11-03 13:51:07 +00:00
|
|
|
completed system yet.)
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 5.
|
|
|
|
The executable
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /linuxrc
|
|
|
|
sets
|
|
|
|
.IR /proc/sys/kernel/real-root-dev ,
|
2007-04-12 22:42:49 +00:00
|
|
|
unmount
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /proc ,
|
2004-11-03 13:51:07 +00:00
|
|
|
the normal root file system and any other file
|
|
|
|
systems it has mounted, and then terminates.
|
2008-01-12 08:55:00 +00:00
|
|
|
.IP 6.
|
|
|
|
The kernel then mounts the normal root file system.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 7.
|
|
|
|
Now that the file system is accessible and intact,
|
2004-11-03 13:51:07 +00:00
|
|
|
the boot loader can be installed.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 8.
|
|
|
|
The boot loader is configured to load into
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
a file system with the set of modules that was used to bring up the system.
|
2008-09-10 03:40:20 +00:00
|
|
|
(e.g., Device
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/ram0
|
2004-11-03 13:51:07 +00:00
|
|
|
can be modified, then unmounted, and finally, the image is written from
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/ram0
|
2004-11-03 13:51:07 +00:00
|
|
|
to a file.)
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 9.
|
|
|
|
The system is now bootable and additional installation tasks can be
|
2004-11-03 13:51:07 +00:00
|
|
|
performed.
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
The key role of
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/initrd
|
close.2, epoll_create.2, epoll_ctl.2, fcntl.2, madvise.2, mmap.2, mremap.2, select_tut.2, setgid.2, setuid.2, syscalls.2, vmsplice.2, dlopen.3, fts.3, getpw.3, stdio.3, fd.4, initrd.4, random.4, sd.4, bootparam.7, capabilities.7, cpuset.7, epoll.7, inotify.7, man.7, socket.7, x25.7: Global fix: s/re-/re/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "re-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 17:45:23 +00:00
|
|
|
in the above is to reuse the configuration data during normal system operation
|
2004-11-03 13:51:07 +00:00
|
|
|
without requiring initial kernel selection, a large generic kernel or,
|
|
|
|
recompiling the kernel.
|
|
|
|
.PP
|
|
|
|
A second scenario is for installations where Linux runs on systems with
|
2007-04-12 22:42:49 +00:00
|
|
|
different hardware configurations in a single administrative network.
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
2007-04-12 22:42:49 +00:00
|
|
|
information as small as possible.
|
|
|
|
In this case, create a common file
|
|
|
|
with all needed modules.
|
|
|
|
Then, only the
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
file or a file executed by
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /linuxrc
|
2004-11-03 13:51:07 +00:00
|
|
|
would be different.
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
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
|
|
|
|
.I /dev/initrd
|
|
|
|
can use a dialog and/or auto-detection followed by a
|
2004-11-03 13:51:07 +00:00
|
|
|
possible sanity check.
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
Last but not least, Linux distributions on CD-ROM may use
|
2007-09-20 16:26:31 +00:00
|
|
|
.B initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
for easy installation from the CD-ROM.
|
|
|
|
The distribution can use
|
2007-09-20 16:26:31 +00:00
|
|
|
.B LOADLIN
|
2007-04-12 22:42:49 +00:00
|
|
|
to directly load
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/initrd
|
2004-11-03 13:51:07 +00:00
|
|
|
from CD-ROM without the need of any floppies.
|
2007-04-12 22:42:49 +00:00
|
|
|
The distribution could also use a
|
2007-09-20 16:26:31 +00:00
|
|
|
.B LILO
|
2010-08-29 05:01:30 +00:00
|
|
|
boot floppy and then bootstrap a bigger RAM disk via
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/initrd
|
|
|
|
from the CD-ROM.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2008-08-05 16:42:24 +00:00
|
|
|
.SH FILES
|
|
|
|
.I /dev/initrd
|
|
|
|
.br
|
|
|
|
.I /dev/ram0
|
|
|
|
.br
|
|
|
|
.I /linuxrc
|
|
|
|
.br
|
|
|
|
.I /initrd
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NOTES
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 1. 3
|
|
|
|
With the current kernel, any file systems that remain mounted when
|
2008-01-12 08:55:00 +00:00
|
|
|
.I /dev/ram0
|
|
|
|
is moved from
|
|
|
|
.I /
|
|
|
|
to
|
|
|
|
.I /initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
continue to be accessible.
|
|
|
|
However, the
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /proc/mounts
|
2007-04-12 22:42:49 +00:00
|
|
|
entries are not updated.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 2.
|
|
|
|
With the current kernel, if directory
|
2008-01-12 08:55:00 +00:00
|
|
|
.I /initrd
|
|
|
|
does not exist, then
|
2007-04-12 22:42:49 +00:00
|
|
|
.I /dev/ram0
|
2007-12-14 13:27:50 +00:00
|
|
|
will
|
2007-12-14 13:23:07 +00:00
|
|
|
.B not
|
|
|
|
be fully unmounted if
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/ram0
|
2004-11-03 13:51:07 +00:00
|
|
|
is used by any process or has any file-system mounted on it.
|
2007-04-12 22:42:49 +00:00
|
|
|
If
|
2008-01-12 08:55:00 +00:00
|
|
|
.IR /dev/ram0
|
|
|
|
is
|
2007-12-14 13:23:07 +00:00
|
|
|
.B not
|
2008-01-12 08:55:00 +00:00
|
|
|
fully unmounted, then
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/ram0
|
2004-11-03 13:51:07 +00:00
|
|
|
will remain in memory.
|
2007-06-15 19:32:07 +00:00
|
|
|
.IP 3.
|
|
|
|
Users of
|
2007-09-20 16:26:31 +00:00
|
|
|
.I /dev/initrd
|
2007-04-12 22:42:49 +00:00
|
|
|
should not depend on the behavior give in the above notes.
|
2004-11-03 13:51:07 +00:00
|
|
|
The behavior may change in future versions of the Linux kernel.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
2007-06-08 12:01:06 +00:00
|
|
|
.\" .SH AUTHORS
|
|
|
|
.\" The kernel code for device
|
|
|
|
.\" .BR initrd
|
|
|
|
.\" was written by Werner Almesberger <almesber@lrc.epfl.ch> and
|
|
|
|
.\" Hans Lermen <lermen@elserv.ffm.fgan.de>.
|
|
|
|
.\" The code for
|
|
|
|
.\" .BR initrd
|
|
|
|
.\" was added to the baseline Linux kernel in development version 1.3.73.
|
2007-05-16 18:25:50 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR chown (1),
|
|
|
|
.BR mknod (1),
|
|
|
|
.BR ram (4),
|
|
|
|
.BR freeramdisk (8),
|
|
|
|
.BR rdev (8)
|
|
|
|
|
|
|
|
The documentation file
|
|
|
|
.I initrd.txt
|
|
|
|
in the kernel source package, the LILO documentation,
|
|
|
|
the LOADLIN documentation, the SYSLINUX documentation.
|