LinuxCommandLibrary

initramfs-tools

TLDR

Update initramfs for current kernel

$ sudo update-initramfs -u
copy
Create new initramfs
$ sudo update-initramfs -c -k [$(uname -r)]
copy
Update all initramfs images
$ sudo update-initramfs -u -k all
copy
Delete initramfs for kernel
$ sudo update-initramfs -d -k [5.10.0-1]
copy
Show verbose output
$ sudo update-initramfs -u -v
copy

SYNOPSIS

update-initramfs [options]

DESCRIPTION

initramfs-tools manages the initial RAM filesystem (initramfs) on Debian-based systems. The initramfs contains the minimal filesystem loaded before the real root filesystem is mounted.
It includes drivers, scripts, and tools needed for early boot, such as filesystem drivers, LVM, RAID, or encryption setup.

PARAMETERS

-c

Create new initramfs.
-u
Update existing initramfs.
-d
Delete initramfs.
-k version
Kernel version (or "all").
-v
Verbose output.
-b directory
Set boot directory.

CONFIGURATION

$ /etc/initramfs-tools/initramfs.conf    Main config
/etc/initramfs-tools/modules           Modules to include
/etc/initramfs-tools/hooks/            Hook scripts
/etc/initramfs-tools/scripts/          Boot scripts
copy

CAVEATS

Debian/Ubuntu specific. Incorrect configuration may prevent boot. Always keep a working backup. Custom modules need manual configuration.

HISTORY

initramfs-tools replaced the older initrd mechanism on Debian. It provides a modular, scriptable framework for building the initial filesystem, developed by the Debian project.

SEE ALSO

Copied to clipboard