Right, so the kernel is finally loaded, but it’s not out of the woods yet. It’s sitting there in memory, a perfectly good brain for your computer, but it has a problem: it doesn’t know how to talk to anything yet. It’s like a brilliant neurosurgeon who’s been dropped into a hospital with no idea where the light switches are. Its own code (vmlinuz) is there, but the drivers to access the root filesystem—where all its essential tools and the rest of the OS live—are on that very filesystem it can’t yet read. It’s a classic chicken-and-egg problem, and the solution is one of the more clever hacks in this whole boot process.

The Compressed Kernel: vmlinuz

First, let’s talk about that kernel file you’ve seen, vmlinuz. The vmlin part stands for “virtual memory Linux,” a holdover from when the kernel could only run in protected mode. The z is the important bit: it means it’s compressed. We compress the kernel for the same reason you squeeze the air out of a zip-lock bag before a trip—to save precious space in the bootloader’s tiny, cramped environment (often a 512-byte sector world). The kernel knows how to decompress itself, so it’s a free win. You can see what your running kernel was built with by peeking at its boot message:

dmesg | grep "compression algorithm"
# On my machine, it proudly reports: [    0.309789] Linux kernel image load address: 0x40200000, entry point: 0x40200000
# ...and later... [    0.311185] Built 1 zonelists, mobility grouping on.  Total pages: 2064164
# Not as explicit, but you get the idea.

The actual file is just a blob of compressed code. You can prove it’s compressed by trying to peek at it with strings; you’ll get mostly gibberish, unlike the uncompressed version which would be somewhat readable.

The Initial RAM Disk: initrd/initramfs

This is the kernel’s survival kit. The Initial RAM Disk (initrd) or its more modern successor, the Initial RAM Filesystem (initramfs), is a small, self-contained filesystem image that is loaded into memory alongside the kernel by the bootloader. The kernel, upon starting, unpacks this image into a temporary, in-memory filesystem (a tmpfs). This mini-environment contains just enough utilities and, crucially, kernel modules (drivers) to let the kernel talk to the real hardware—be it SATA, NVMe, USB, or even LVM or encrypted partition software.

Without this, if your root filesystem is on an LVM volume inside a LUKS encryption container, the vanilla kernel would just stare blankly at the block device, have no idea what to do with it, and panic. The initramfs contains the cryptsetup and lvm tools to unlock and assemble the real root.

You can see what your current system used on boot by looking at the initrd line in /boot/grub/grub.cfg or by checking the boot messages with dmesg | grep -i initrd. On most modern distributions, it’s a cpio archive (the standard for initramfs) compressed with gzip or lz4.

Kernel Parameters: Your Boot-Time Swiss Army Knife

This is where you, the human, get to shout instructions at the kernel as it’s waking up. These parameters are text strings appended to the kernel command line in your bootloader configuration (GRUB, systemd-boot, etc.). They can do everything from specifying the root device to enabling profound debugging or completely altering kernel behavior.

A common one you might need in a pinch is root=, which tells the kernel where its real root filesystem is after the initramfs has done its job.

# Example of a kernel command line from /proc/cmdline
cat /proc/cmdline
# Might output something like:
# BOOT_IMAGE=/boot/vmlinuz-5.15.0-91-generic root=UUID=abcd1234-5678-... ro quiet splash

Let’s break that down:

  • root=UUID=abcd1234...: Use the partition with this UUID as the root. Using a UUID is best practice; device names like /dev/sda1 can change, but UUIDs are unique.
  • ro: Mount the root filesystem as read-only initially. The system will later remount it as read-write. This is a safety measure to allow fsck to run on a clean filesystem.
  • quiet splash: Shut up, and show me a pretty splash screen instead of all the boot messages. (We disable this when things go wrong to see what’s happening).

Here’s a real-world example of a troubleshooting parameter: if your system is hanging on boot, you can break into a shell inside the initramfs to poke around. Edit the GRUB entry at boot time (hit ’e’ in GRUB) and add break=premount to the kernel parameters. This will halt the boot process before it tries to mount the real root and drop you into a BusyBox shell. It’s incredibly useful for fixing broken initramfs or missing root devices.

# Example of how to add a parameter in GRUB (this line is for illustration)
linux /boot/vmlinuz-linux root=UUID=1234... ro break=premount

Other invaluable parameters include nomodeset (to bypass problematic GPU drivers and boot into a basic display) and systemd.unit=rescue.target (to boot directly into rescue mode). These aren’t runtime commands; they’re one-time instructions shouted at the kernel as it starts its day. Use them wisely.