Initramfs
Initial RAM File System or initramfs is a cpio archive, typically compressed, and contains files needed to boot a Linux installation. initramfs has been introduced in Linux kernel since 2.6, and continues to be used in installations that makes use of it.
Contents |
Discussion
Hardware drivers are often included in Linux kernel, and can be either built into the kernel, or using the likes of initramfs to enable early loading at compile time. In many modern Linux distros, these drivers, along with other necessary components such as their firmware, are included as a separate file, and initramfs being an option. Without initramfs on a system that is configured to use such mechanisms, may cause kernel panic at worst. A kernel panic is the (rough) equivalent of Microsoft Windows Blue Screen of Death (or BSoD), where booting is halted upon a fatal error, and that the process cannot be continued.
Strictly speaking, initramfs may not be required if all the necessary files are compiled into the kernel, at the expense of having larger vmlinuz-linux
in traditional context. In modern context, it is possible to replace kernel and initramfs solution with Unified Kernel Image (UKI).[1][2][3]
initramfs are also generally compressed cpio archive, typically using the likes of stream compression, such as gzip, bzip2, xz, or zstd
Identification
Initramfs files are usually stored in `/boot` and has extension .img
, e.g. /boot/initramfs-linux.img
.
Software
- Initramfs creation:
- See cpio page on viewing the generated initramfs contents.