I’ve recently switched to using Linux on my main PC. It’s been years since I’ve used it as my main OS, aside from working on server installs of for work.
For my distro of choice, I’ve landed on CachyOS. It’s based on Arch Linux, which I’ve always enjoyed, but pre-configured for gaming, which is nice. I did try Bazzite but didn’t like the limitations of it being a immutable OS.
Anyways, I digress – this post isn’t about switching to Linux, this is about troubleshooting an issue I ran into.
The other day, after installing the latest updates, I was met with a rather foreboding black screen announcing I had been ‘dropped into an emergency shell’. As any Linux user knows, this usually isn’t a good thing. The error on said screen:
WARNING: Blake2b hash for <my drive URI> does not match!
I ended up booting to my recovery live USB and ch-rooted in, and ran pacman -Syu linux-cachy-os linux-cachyos-headers to reinstall the kernel, thinking that might help. But after rebooting:
mount: /new_root: wrong fs type, bad option, bad superblock on, missing code page or helper program, or other error. ERROR: Failed to mount ' ' on real root
It wasn’t very helpful, since it didn’t say what exactly it was failing to mount. After a few days of searching, forum posting, and other troubleshooting, I finally found the fix.
The fix
I’m using Limine bootloader with snapshots so I can restore if something goes wrong. Unfortunately, all my snapshots also resulted in the same error. It turns out that somehow, my /boot/limine.conf was missing the UUID and rootflags=subvol=@ to tell it where the root actually was.
So, I’m documenting it here in case I come across the issue again, and also in case anyone googles it and finds this post and it might be helpful.
Step 1: Boot into recovery USB. Open a terminal and run:
sudo lsblk -f
This will output your drives. Take note of the path of your root partition (mine was at /dev/sdc2). Reboot.
Back in the emergency shell, you need to mount your partition as new_root:
mount -o subvol=@ /dev/sdc2 /new_root
Type exit an d your system should now boot into the OS!
But you’re not finished yet. If you reboot you’ll be dumped back into the emergency shell. You’ll need to fix your /boot/limine.conf entry.
Open a terminal and run:
sudo lsblk -f
This time, take note of your root partition’s UUID.
Now, run:
sudo nano /boot/limine.conf
Look for your main boot entry. It will look something like this:
/+CachyOS
comment: CachyOS
comment: machine-id=e2d598a36bcb4884947d32ec8fef3193 order-priority=50
//linux-cachyos
### This kernel entry is auto-generated by limine-entry-tool
comment: Kernel version: 6.18.5-2-cachyos
comment: kernel-id=linux-cachyos
protocol: linux
module_path: boot():/e2d598a36bcb4884947d32ec8fef3193/linux-cachyos/initramfs-linux-cachyos#3ce6a28b8f1205ea57ad72cbd427b88b41f4a49>
path: boot():/e2d598a36bcb4884947d32ec8fef3193/linux-cachyos/vmlinuz-linux-cachyos#9f29733195406d062723197e8eb7b4b3f07add5f8025c115 ...
Where it says cmdline: add:
root=UUID=c14cd9ed-e310-4119-b2f2-b8245bb6d03a rootflags=subvol=@
I also added quiet splash because mine was missing those and was doing a verbose boot.
Hit Ctrl+X to close and save the file, and reboot. Your system should now boot normally!
Leave a Reply