When Your Linux System Hits Emergency Mode: initramfs & fsck

Published: (December 9, 2025 at 11:07 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

What is initramfs?

When you first see that word, it sounds alien, right?
initramfs stands for initial RAM filesystem. It is a small temporary filesystem that is loaded into RAM by the bootloader before your main OS filesystem is mounted. Think of it as a toolkit containing the things needed to mount your main filesystem.

What is fsck?

fsck stands for file system integrity check. It is a tool you use when something goes wrong with your file system. Common reasons to run fsck include:

  • Improper shutdowns
  • Power cuts
  • Disk errors
  • Corrupted filesystems

When fsck detects issues, it will attempt to repair them automatically or prompt you for confirmation.

Example of initramfs and fsck

The initramfs shell looks like this:

(initramfs) _

In this shell you can run commands such as:

fsck /dev/sda1          # check and repair root partition
mount /dev/sda1 /root   # try mounting manually

A simple 6‑step example of how initramfs and fsck interact:

  1. System boots, kernel loads.
  2. Kernel loads initramfs into RAM.
  3. initramfs tries to mount /, fails.
  4. You are dropped into the initramfs shell.
  5. Run fsck to fix the filesystem.
  6. Reboot. If successful, the system boots normally.

Wrapping up

You now have a basic idea of what initramfs and fsck are and how they fit together during the boot process.

Back to Blog

Related posts

Read more »