Unfortunately, I am getting loss and have not found a solution that works. My problem is the following:
I use Windows 11 and Fedora 39 as Dual Boot. After the last windows/bios update, notebook starts directly in Windows. I can’t find a easy and workable solution to show GRUB on boot again.
No options in bios/uefi and also boot-repair-disk (boot-repair-disk download | SourceForge.net) don’t work. boot-repair-disk don’t shows the “Recommended Repair” button and also with advanced I see nothing. Maybe because my Fedora filesystem is btrfs??
Also when I boot into the UEFI boot menu, I only see the Windows Bootloader. No entry for Fedora.
So I need your help and kindly ask for an step-by-step tutorial to fix/repair/reinstall GRUB
(I can use the installed Windows 11 or the Fedora 39 Live CD)
Hello Marko,
thats my problem: I found no solution to boot into Fedora. Entry is not available in UEFI Boot menu. I can only boot into Windows 11 or start Fedora from USB-Stick.
Is there a solution to fix this from Windows or with Fedora Live (USB-Stick)
You can use a Fedora Live USB to chroot/systemd-nspawn into your broken Fedora and fix grub from there. Let me gather some instructions for you. I have old notes.
Once you’re in the Fedora Live environment, open a terminal.
Identify the partition where Fedora is installed. You can use the lsblk command to list all available block devices and their mount points.
Identify and Mount Partitions:
Once you’re in the Fedora Live environment, open a terminal.
Use the lsblk command to identify the partitions. Typically, you’ll have a separate boot partition (e.g., /dev/sda1) and the root partition (e.g., /dev/sda2 for Fedora).
Mount the root partition: sudo mount /dev/sda2 /mnt
Mount The Boot paritions: sudo mount /dev/sda1 /mnt/boot
Prepare the systemd-nspawn Environment:
sudo systemd-nspawn -D /mnt
Reinstall GRUB:
grub2-install /dev/sda
Update GRUB Configuration:
grub2-mkconfig -o /boot/grub2/grub.cfg
Exit the systemd-nspawn environment:
exit
Then, unmount the partitions:
sudo umount /mnt/boot /mnt
Safely reboot your system and remove the Fedora Live media.
You should see the GRUB menu allowing you to choose between Windows and Fedora. Test both entries to ensure they boot correctly.
Your instructions are great for systems using MBR boot, but do not account for the changes from ext4 to btrfs and sub-volumes, nor do they account for use of UEFI.
Windows 11 only uses UEFI so the fedora install also uses UEFI and proper instructions must reflect that.
When in the live system first make certain that the internet connection is properly functioning.
Then to mount the root subvolume with a btrfs file system it would be necessary to identify the btrfs partition with lsblk -f then mount it as.
su to enter the root user environment
mount -t btrfs -o subvol=root,compress=zstd:1 UUID=<uuid of btrfs partition> /mnt
then mount the other needed system file systems as
for fs in proc sys run dev ; do mount -o bind /$fs /mnt/$fs ; done
chroot /mnt
mount -a which will then mount the remaining file systems for the installed system according to the /etc/fstab entries.
then perform the steps above to repair grub.
I have not tried systemd-nspawn but if that works as it appears from the man page then it may be possible to replace my steps 3 thru 5 with the systemd-nspawn command given above.
So the mount command could be /dev/sdaX /mnt -o subvol=@ instead? I should try this real quick in a VM while I’m here. Outside of that I do not see much difference in the commands
Would you have some points to add, amend to this process? I stated earlier these are older commands and I did make assumptions as the Title does say F39. I do not know may people who frequent the forums to use my type of setup with systemd-boot , Most users are running Grub/standard installs.
I agree, and the instructions I give here seem correct for recovery as long as the live system is booted into the proper mode. Though it is important to note that systemd-boot is significantly different than grub boot. The standard fedora btrfs structure does not name a subvol as @ (I think that may be a systemd boot requirement). The root file system is in the subvol root instead.
mount /dev/nvme0n1p7 /mnt/ mount /dev/nvme0n1p6 /mnt/root/boot mount /dev/nvme0n1p1 /mnt/root/boot/efi
mount -o bind /dev /mnt/root/dev mount -o bind /sys /mnt/root/sys mount -o bind /proc /mnt/root/proc mount -o bind /run /mnt/root/run
chroot /mnt/root
mount -a
dnf reinstall grub2* shim
This works fine and I can access my local fedora files
grub2-install /dev/nvme0n1
Installing for x86_64-efi platform.
grub2-install: error: This utility should not be used for EFI platforms because it does not support UEFI Secure Boot. If you really wish to proceed, invoke the --force option.
Make sure Secure Boot is disabled before proceeding.
Secure Boot is disabled. If I try to use the --force command I also get an error:
Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub2-install: error: efibootmgr failed to register the boot entry: No such file or directory.
How can I install it for UEFI??
grub2-mkconfig -o /boot/grub2/grub.cfg
/usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?).
What is the output of mount while in the chroot environment? Does it show /dev properly mounted? Does it show all the required devices mounted?
/
/boot
/boot/efi
/home
/dev
/sys
/proc
/run
If you exit from the chroot environment all those should show an entry at /mnt/root/…
There also may be a discrepancy depending upon which live iso you are using to boot (kernel related). The release version of the iso had kernel 6.5.6. Your installed system likely has kernel 6.8.X (or maybe 6.7.X). Grub has been updated as well.
Booting from the live iso obtained from Index of /pub/alt/live-respins would give you an iso with (almost) current software and kernel which probably would assist with that grub2-mkconfig error since the booted kernel would be much closer to the updated kernel on the installed system (as would be almost all the other software). The respin iso as of today is dated 20240401.
Note that root and home are both on /dev/nvme0n1p7 , but need to be mounted using -0 subvol=<name>... as shown above in @computersavvy’s post. Note that there is no need to mount the home subvolume.
just open Microsoft_window boot efi and select Fadora as first boot option in Boot configration… this can be done by presing power button+volume down in surface laptop, your may be different ,just try this.