© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
BazziteB
Bazzite•4mo ago•
301 replies
Absolpega

Accidentally wiped grub (need to reinstall)

I just accidentally did
sudo rm -rf /boot/efi/EFI
sudo rm -rf /boot/efi/EFI
. I don't want to talk about it...
I now need to reinstall grub but I can't figure out how.

I'm still in the system and I would like to shutdown soon-ish, quick help would be a godsend.

The fedora docs give this command
dnf reinstall shim-\* grub2-efi-\* grub2-common
dnf reinstall shim-\* grub2-efi-\* grub2-common
but that's not helpful to me.
I tried to do
sudo rpm-ostree install --allow-inactive shim-\* grub2-efi-\* grub2-common
sudo rpm-ostree install --allow-inactive shim-\* grub2-efi-\* grub2-common
but that did nothing.
ujust regenerate-grub
ujust regenerate-grub
also did nothing.
Most promising felt
sudo bootupctl validate
sudo bootupctl validate
but that failed with this output
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] Gathering status for installed component: EFI
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::bootupd] Remaining known components: 1
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::blockdev] Found parent devices: ["/dev/sdb"]
[DEBUG bootupd::blockdev] Found esp partitions: ["/dev/sdb1"]
[DEBUG bootupd::efi] Reusing existing mount point "/boot/efi"
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::efi] Unmounted
error: opening EFI dir /boot/efi: No such file or directory (os error 2)
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] Gathering status for installed component: EFI
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::bootupd] Remaining known components: 1
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::blockdev] Found parent devices: ["/dev/sdb"]
[DEBUG bootupd::blockdev] Found esp partitions: ["/dev/sdb1"]
[DEBUG bootupd::efi] Reusing existing mount point "/boot/efi"
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::efi] Unmounted
error: opening EFI dir /boot/efi: No such file or directory (os error 2)
Solution
just a summary if anyone ends up in the same situation as me

you need to run
dnf install grub2-efi grub2-efi-modules shim-\*
dnf install grub2-efi grub2-efi-modules shim-\*
in a fedora distrobox container
then copy the /boot/efi/EFI/fedora from the container into your host
after that you need to download the
gen_grub_cfgstub
gen_grub_cfgstub
script and run it like so
sudo ./gen_grub_cfgstub "/boot/grub2" "/boot/efi/EFI/fedora"
sudo ./gen_grub_cfgstub "/boot/grub2" "/boot/efi/EFI/fedora"


DO NOT use
grub-mkconfig
grub-mkconfig

if you did, you will have to find the original static one that uses blscfg
Jump to solution
BazziteJoin
The operating system for the next generation of gamers.
29,482Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Next page

Similar Threads

Fixing grub after reinstall...
BazziteBBazzite / 🛟bazzite-help
3mo ago
Reinstall GRUB (bazzite still boots) [Solved]
BazziteBBazzite / 🛟bazzite-help
5mo ago
Need help reinstalling Grub after trying to set up dual boot
BazziteBBazzite / 🛟bazzite-help
6mo ago
Grub
BazziteBBazzite / 🛟bazzite-help
4mo ago