$linuxjunkies
>

initramfs

also: initrd, initial RAM disk, early userspace

A compressed archive containing a minimal root filesystem and kernel modules loaded into RAM during boot, before the real root filesystem is mounted. It enables the kernel to access storage devices and prepare the system for startup.

initramfs (initial RAM filesystem) is a temporary filesystem that exists entirely in memory during the early stages of Linux boot. It contains essential drivers, tools, and scripts needed to detect hardware, mount the real root filesystem, and hand control over to init.

When the bootloader loads the kernel, it also loads the initramfs image. The kernel extracts this archive and executes /init, which typically uses udev to load necessary device drivers and then mounts the actual root filesystem from disk (or network). Once the real root is ready, the initramfs is discarded.

Modern systems typically use initramfs instead of the older initrd approach. On Debian/Ubuntu systems, initramfs images are built by update-initramfs and stored as /boot/initrd.img-* files. You can inspect one with: lsinitramfs /boot/initrd.img-5.15.0-generic

Related terms