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.
You just saved my system! Fedora 36, just ran an update that included kernel 5.19.13, and rebooted. Maybe I rebooted too quickly after the update was complete — not giving akmods enough time to finish… I don’t know what the problem was. But, after this, not even the recovery image would finish loading. I saw that it was trying to fsck, but would never run to completion, then complained about missing initramfs.
Googling “fedora missing initramfs” brought me here, I ran ‘fsck /dev/mapper/fedora-root -y’, and now I’m back up and running. Thank you.
Glad it worked. Happy to help.
Hey there fellas. My name is Lee. I am experiencing a problem after my toddler was found in my office unattended. Fedora won’t boot and I keep getting the error message “Generating “/run/initramfs/rdsosreport.txt” it then continues “Entering emergency mode. Exit the shell to continue. Type ‘journalctl’ to view system logs. You might want to save ‘/run/initramfs/rdsosreport.txt’ to a USB stick or /boot after mounting them and attach it to a bug report. Press Enter for maintenance (or press Control-D to continue).”
Now I read through the above post and I pressed enter which took me to an sh-5.1# command prompt. I also tried Control-D which took me to a GRUB command prompt. At the sh-5.1# command line I tried “fsck/dev/mapper/fedora-root -y” and it returned “No such file or directory” and took me back to “sh-5.1#.”
Guys Im truly stumped here. I was operating Fedora Server 37 before all of this. Please advise, I truly appreciate your expertise.
Probably you’re trying to fix wrong a partition. Please run
blkidcommand to list the partitions and then
fsck /actual/path/of/partition/ -y(E.g. fsck /dev/sdx1 -y, fsck /dev/sdx2 -y …).