Skip to main content

initrd (initialisation RAM disk)

initrd


What is initrd?

initrd (initialisation RAM disk) is essentially a set of instructions used to load the kernel. initrd is stored temporarily in system memory whilst the kernel is loaded.


Which file in /boot is initrd?

The initrd file will be prefaced with just that - initrd:

initrd.img-5.15.0-106-generic

To check which initrd file is currently being treated as the primary one (which will be loaded on boot), you can check the symlinks (in /boot), as below:

initrd.img -> initrd.img-5.15.0-107-generic

initrd.img.old -> initrd.img-5.15.0-106-generic


mkinitrd

mkinitrd is a command used for creating or modifying an initrd. mkinitrd is typically used on much older systems. Modern systems have tools in place to automatically detect the modules required for the ram disk.

mkinitrd [options] initrdimagename kernel.version
mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)

 

OptionFunction
--preload=modulenameLoad a module in the initrd image before the loading of other modules.
--with=modulenameLoad a module in the initrd image after the loading of other modules.
-fOverwrite an existing initrd image file.
-nocompressDisable the compression of the initrd image.