1

I have a dual boot (Fedora & Windows 10), after a glitch from Windows, the machine only boots using the Windows' boot loader and not grub2 as before.

How can I get grub2 back?

What I tried:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.5.7-300.fc24.x86_64
Found initrd image: /boot/initramfs-4.5.7-300.fc24.x86_64.img
Found linux image: /boot/vmlinuz-4.4.4-301.fc23.x86_64
Found initrd image: /boot/initramfs-4.4.4-301.fc23.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-f4a99c4a747b4f928c2ad16c434a731d
Found initrd image: /boot/initramfs-0-rescue-f4a99c4a747b4f928c2ad16c434a731d.img
Found linux image: /boot/vmlinuz-0-rescue-b80563ee4ffb43768b1936a46d9cd0d5
Found initrd image: /boot/initramfs-0-rescue-b80563ee4ffb43768b1936a46d9cd0d5.img
Found Windows Boot Manager on /dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi
done

After a reboot, straight back into Windows.

[root@nightwatch] # efibootmgr -v         
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0000,0003,0001,0002
Boot0000* Windows Boot Manager  HD(1,GPT,d602a4af-b36c-4bf9-83b4-5d93295600bb,0x800,0x64000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...,................
Boot0001  Hard Drive    BBS(HD,,0x0)..GO..NO........o.H.i.t.a.c.h.i. .H.D.S.7.2.1.0.1.0.C.L.A.3.3.2....................A...........................>..Gd-.;.A..MQ..L. . . . . . .P.J.9.2.1.2.Q.H.7.1.7.G.A.M........BO..NO........o.S.a.m.s.u.n.g. .S.S.D. .8.4.0. .E.V.O. .1.T.B....................A...........................>..Gd-.;.A..MQ..L.1.S.9.D.S.N.F.A.1.7.5.5.8.7. .F. . . . ........BO..NO........o.H.i.t.a.c.h.i. .H.D.T.7.2.1.0.1.0.S.L.A.3.6.0....................A...........................>..Gd-.;.A..MQ..L. . . . . . .T.S.6.F.7.0.H.M.X.2.K.W.K.4........BO..NO........o.H.i.t.a.c.h.i. .H.D.S.7.2.2.0.2.0.A.L.A.3.3.0....................A...........................>..Gd-.;.A..MQ..L. . . . . . .K.J.1.1.0.7.B.Y.X.H.P.Y.D.9........BO..NO........o.S.a.m.s.u.n.g. .S.S.D. .8.5.0. .E.V.O. .5.0.0.G.B....................A...........................>..Gd-.;.A..MQ..L.2.S.J.1.S.N.G.A.5.2.1.8.6.7. .J. . . . ........BO
Boot0002  CD/DVD Drive  BBS(CDROM,,0x0)..GO..NO........o.T.S.S.T.c.o.r.p. .C.D.D.V.D.W. .S.H.-.2.2.4.D.B....................A...........................>..Gd-.;.A..MQ..L.9.R.8.6.Y.6.F.A.0.B.5.0.Z.1. . . . . . ........BO
Boot0003* UEFI: Built-in EFI Shell  VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0006* UEFI: (FAT) TSSTcorp CDDVDW SH-224DB  PciRoot(0x0)/Pci(0x1f,0x2)/Sata(4,65535,0)/CDROM(1,0x59,0x1680)..BO

This is more promising. There is no grub2 entry there…

Finally, in case that helps:

; df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 7.9G     0  7.9G   0% /dev
tmpfs                    7.9G  1.9M  7.9G   1% /dev/shm
tmpfs                    7.9G  1.5M  7.9G   1% /run
tmpfs                    7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/mapper/fedora-root   50G   12G   36G  25% /
tmpfs                    7.9G  1.4M  7.9G   1% /tmp
/dev/sdb2                477M  184M  264M  42% /boot
/dev/mapper/fedora-home  865G   71G  751G   9% /home
/dev/sdb1                200M   45M  155M  23% /boot/efi
tmpfs                    1.6G   16K  1.6G   1% /run/user/1000
/dev/sdd1                1.9T  979G  885G  53% /media/Backups
/dev/sdc1                932G  474G  459G  51% /media/MediaVault
/dev/sda2                444G   46G  398G  11% /media/DataVault

The last three are windows shares mounted. It's sadly easier to mount windows disk on linux than the other way round.

After running grub2-install /dev/sdb, grub2 does indeed load but cannot find any OS to boot.

How to fix that?

In addition, this information was gathered via rescutux disk but it failed to rescue the boot for me.

2

It seems that fedora boot entry in EFI was lost somehow.

To get fedora boot entry back, you can reinstall grub2 to disk in root shell:

grub2-install <YOUR_HDD_DEVICE>

For example: grub2-install /dev/sda

And make sure there's a working grub.cfg file under /boot/grub2, if there's no such file, you can regenerate it in root shell via

  • grub2-mkconfig > /boot/grub2/grub.cfg
  • or grub2-mkconfig -o /boot/grub2/grub.cfg
  • I had to copy the grubenv file manually as grub was complaining it could not find it. – Sardathrion - Reinstate Monica Apr 28 '17 at 9:13
  • Mine is a symbolic link to /boot/efi/EFI/fedora/grubenv file. lrwxrwxrwx 1 root root 28 12月 8 23:50 grubenv -> /boot/efi/EFI/fedora/grubenv – LiuYan 刘研 Apr 28 '17 at 9:22
  • That's what mine was as well but /boot/efi is apparently not mounted at the time grub boots. I was getting error: /grub2/grubenv not found\n Press Any Key To Conitnue. – Sardathrion - Reinstate Monica Apr 28 '17 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.