initramfs-tools
Manage initramfs images
SYNOPSIS
update-initramfs -c | -u | -d [-k kernel_version] [-b boot_directory] [-t temp_directory] [-v] [-h]
PARAMETERS
-c
Create a new initramfs image for the specified kernel version.
-u
Update an existing initramfs image for the specified kernel version.
-d
Delete an initramfs image for the specified kernel version.
-k kernel_version
Specify the kernel version for which the initramfs image should be created, updated, or deleted. If omitted, the currently running kernel version is used.
-b boot_directory
Specify an alternative boot directory where the initramfs images are stored (defaults to /boot).
-t temp_directory
Specify an alternative temporary directory for image generation.
-v
Enable verbose output, showing detailed progress during image generation.
-h
Display a help message and exit.
DESCRIPTION
initramfs-tools is a suite of scripts and utilities primarily used on Debian-based Linux systems to create, update, and manage initial RAM filesystem (initramfs) images. An initramfs is a compressed cpio archive containing a minimal root filesystem, which is loaded into memory during the early stages of the Linux boot process.
Its purpose is to perform essential boot tasks, such as loading necessary kernel modules (e.g., for disk controllers or filesystems), detecting hardware, and locating the actual root filesystem. Once these tasks are complete, the system "switches root" to the real filesystem. The main user-facing command provided by this package is update-initramfs, which automatically generates or modifies the initramfs image whenever a new kernel is installed or its configuration changes, ensuring the system can successfully boot. This mechanism allows for flexible and modular kernel configurations, enabling the use of a generic kernel image across diverse hardware while still providing necessary device support early in the boot sequence.
CAVEATS
Improper configuration of initramfs-tools or its hooks can lead to an unbootable system. Manually modifying the initramfs without understanding its internal structure can cause boot failures.
Custom hooks or configurations might require rebuilding the initramfs image using update-initramfs after changes to take effect.
INITRAMFS HOOKS
initramfs-tools uses a system of 'hooks' – scripts executed during image creation – to include specific modules, binaries, or configuration files into the initramfs. These hooks are located in /etc/initramfs-tools/hooks and /usr/share/initramfs-tools/hooks. They allow system administrators and package maintainers to customize the early boot environment to support specific hardware, encryption setups (e.g., LUKS), or network boot scenarios.
<I>MKINITRAMFS</I> VS <I>UPDATE-INITRAMFS</I>
While initramfs-tools is the package, the primary command for users is update-initramfs. This command acts as a wrapper around the lower-level mkinitramfs script. mkinitramfs is directly responsible for building the initramfs image, but update-initramfs provides a more convenient interface, handling versioning, default paths, and integration with kernel package management. In most cases, users should use update-initramfs.
HISTORY
The concept of an initial RAM disk (initrd) was introduced in Linux to provide a way to load necessary modules before the root filesystem was mounted. initramfs-tools emerged primarily in the Debian/Ubuntu ecosystem as a successor and an improvement upon the initrd mechanism, leveraging the cpio format and the kernel's initramfs support. This shift allowed for a more flexible and robust early boot environment, moving from a block device emulation to a more integrated filesystem image directly loaded by the kernel.
Its development has focused on automating the creation of these images, especially during kernel package installations and upgrades, ensuring system bootability across various hardware configurations.
SEE ALSO
mkinitramfs(8), init(8), dracut(8), kernel(7), cpio(1)