initrd

Tags:

http://en.wikipedia.org/wiki/Initrd

initrd
The initial ramdisk, or initrd is a temporary file system used by the Linux kernel during boot. The initrd is typically used for making preparations before the real root file system can be mounted. When specified, the boot loader loads the ramdisk into memory and passes it on to the kernel, which temporarily mounts it as root and executes the /linuxrc executable.

Rationale
To simplify security updates and their installation process, many Linux distributions also ship a single, generic kernel image that is intended to boot as wide a variety of hardware as possible. The drivers included with this generic kernel image must be modular, as it is not possible to statically compile everything into the one kernel without making it too large to boot from computers with limited memory or from lower-capacity media like floppy disks.

This then raises the problem of detecting and loading the modules necessary to mount the root file system at boot time (or, for that matter, deducing where or what the root file system is).

To further complicate matters, the root file system may be on a software RAID volume, LVM, a network file system of some sort (NFS is common on diskless computers) or on an encrypted partition. All of these require special preparations to mount.

In Linux 2.4 and earlier, the kernel itself handled these with ad-hoc code triggered by special options. These were often fragile, inflexible and duplicated the functionality already available in user-space utilities.

In Linux 2.6, these have been deprecated in favour of the initrd scheme, which solves this problem by introducing an extra stage in the kernel’s boot process. In this stage, a temporary initial root file system, in which user-space tools and programs can be executed, becomes available. The contents of that initial file system are provided by an initrd image.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *