Ubuntu and its derivatives often affected by the initramfs issue. As far as I know, it occurs usually on the disks that are formatted with
ext4 filesystem. I haven't had this problem in BTRFS though. Until today, I thought only the Ubuntu-based systems are affected by this issue. I was wrong! Today, I encountered with the initramfs issue in my Fedora 34 desktop system. I already knew how to fix Initramfs error on Ubuntu Linux. In this guide, I will show you how to solve initramfs error in Fedora.
This was the actual error message that I encountered after switching on my Fedora 34 desktop.
[...] Generating "/run/initramfsrdsosreport.txt" Entering emergency mode. Exit the shell to continue. Type "journelctl" to view the system logs. You might want to save "/run/initramfsrdsosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report. Give root password for maintenance mode (or press Control-D to continue): :/root#
As you see in the above output, Fedora has entered into emergency mode. If you look a bit above in the screenshot, file system check on one of the disk partitions is failed.
To solve initramfs error in Fedora, we need to check and repair the file system in the problematic partition using
fsck command. In my case, the
/dev/sda2 partition is corrupted.
# fsck /dev/sda2 -y
/dev/sda2 in the above command with your partition name. In your system, the partition could be different like
/dev/sdc1 etc. To find the Linux partition details, you use either
cat /proc/partitions or
blkid command. If you're not sure which partition to repair, run
fsck on all partitions.
fsck command will check for the bad blocks in the given partition's filesystem and fix them automatically. This will take a minute or two depending upon the size of the disk and the number of bad blocks in it.
[...] /dev/sda2: ***** FILE SYSTEM WAS MODIFIED ***** /dev/sda2: 662372/4507520 files (0.4% non-contiguous), 7510236/10350080 blocks
fsck command repaired all bad blocks in the partition, type
exit and press ENTER to start booting your Fedora system:
Now your system should boot normally.
The above solution worked just fine for me. Just in case if it doesn't help, follow the instructions provided by one of our reader in an another article.
- Boot the system from a rescue CD/DVD/USB-memory stick with the same GNU/Linux distribution version
- And then first check hardware (
dmesgshows for example whether hard disks are operational or producing failing messages)
- Next, run
fsckon all of the [unmounted] file system partitions to verify if they are functioning properly.
If that does not fix the boot up problem, then it is possible from the rescue booted system to do further repairs and even to reinstall any essential corrupted software.