Ask Your Question

fedora 25 no longer boots after upgrade.. how to fix?

asked 2017-01-01 14:17:38 -0600

ura_soul gravatar image

i upgraded my lenovo laptop to fedora 25 several weeks ago and it had been running fine until a couple of days ago when i ran a large update process (600mb +) and after reboot i now see the minimal grub command line interface. i have read through many different webpages that attempt to provide fixes for the problem, but so far none have made any difference. (n.b. i have a dual boot system here with windows 10). suggestions i have seen already, but that do not work for me, include:

  • run grub2-mkconfig (including the path to the config file) and then reboot.. outcome: no change.
  • re-install grub (resulted in error, but i now understand that there is no need to reinstall grub since grub is already installed - as demonstrated by the fact that i am taken to the minimal grub interface on initial boot).

i have been accessing these commands by booting from a usb key (the net installer for fedora 25 - 64bit) and then running the rescue process from the troubleshooting section there.

most of the pages i have seen that address this issue, including the official fedora documentation, are out of date and so it took me a while just to realise that i needed to be running grub2 commands instead of the 'grub' commands that the documentation mentions.

anyone got any ideas what the cause of and fix for this issue is? thanks

edit retag flag offensive close merge delete


aha! great answer, thanks. i ran the commands and rebooted. the result was that after a couple of minutes of processing SElinux file descriptors of some kinds and then rebooting a 2nd time, i was/am able once again to login and use fedora. i did take some photos of the output that was printed by each of the commands given here, let me know if you want to see them for debugging fedora and i will add them to the comments here. thanks again

ura_soul gravatar imageura_soul ( 2017-01-02 11:00:43 -0600 )edit

That sounds like an automatic SELinux relabel took place. The main point of the grep command is to get a hint for what the installer used to add the necessary boot entry to NVRAM, in case the efibootmgr -v doesn't show a Fedora entry.

cmurf gravatar imagecmurf ( 2017-01-02 16:05:33 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2017-01-23 20:40:10 -0600

hellork gravatar image

updated 2017-01-23 22:27:42 -0600

For those coming into this via search, here's how we fixed it. We had this problem, too, on an encrypted partition no less.

The first step was to burn a Fedora Live image DVD. The netinstall image kernal panic'd.

Booted to desktop and opened a terminal.

Found the name of the encrypted partition in order to mount it:

blkid | grep crypto

sample output: /dev/sda3: UUID="VERY LONG NUMBER" TYPE="crypto_LUKS"

Opened the partition and set up a mapping name:

cryptsetup luksOpen /dev/sda3 foo #example name

Entered a passphrase to decrypt the partition. The mapped partition is now available in /dev/mapper/foo

(If it isn't a volume group, create a mount point and to mount the mapped partition: mkdir /mnt/foo && mount /dev/mapper/foo /mnt/foo)

Since ours was a volume group:

mount /dev/mapper/fedora-root /mnt -t ext4

Now comes the fun part. Mounting chroot:

mount /dev/sda2 /mnt/boot mount /dev/sda1 /mnt/boot/efi mount --bind /dev /mnt/dev mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys mount --bind /run /mnt/run chroot /mnt

Proceed with the update.

dnf -y update

It seems that grub2-efi and friends were missing. Not sure how they could have gotten removed, or if absolutely required, but it's part of this solution anyway.

dnf install grub2-efi grub2-efi-modules shim

Reconfigured boot menu entries.

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Made sure Fedora shows up in program.log and shim.efi looks good.

grep efibootmgr /var/log/anaconda/program.log

00:32:13,605 INFO program: Running... efibootmgr 00:32:13,877 INFO program: Running... efibootmgr -b 0003 -B 00:32:14,174 INFO program: Running... efibootmgr -c -w -L Fedora -d /dev/sda -p 1 -l \EFI\fedora\shim.efi

Upon rebooting, there was this error:

Cannot find linux16 or 'initrd16'

Repeated the above steps to chroot. Edited grub.cfg and changed occurances of "linux16" to "linuxefi" and "initrd16" to "initrdefi"

Upon rebooting a second time, we got a little bit further:

"Failed to load SELinux policy. Freezing." message.

Had to install selinux-policy-targeted (somehow it was gone, too) (or one could set to enforcing in /etc/selinux/config)

touch /.autorelabel and reboot

edit flag offensive delete link more

answered 2017-01-02 11:01:49 -0600

ura_soul gravatar image

the solution that worked for me was to use the code provided in the first comment from cmurf

edit flag offensive delete link more

answered 2017-01-01 22:42:16 -0600

cmurf gravatar image

updated 2017-01-01 22:44:32 -0600

Boot from netinstall image, choose the troubleshooting > rescue option, it should assemble the system at /mnt/sysimage. Then do this:

chroot /mnt/sysimage
dnf reinstall grub2-efi
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
efibootmgr -v
grep efibootmgr /var/log/anaconda/program.log

Post the results here; the gist is that you need a boot entry directing the firmware to shim.efi, and it needs to be the first entry in the Boot Order.

edit flag offensive delete link more


This resolved my issue with Fedora 27. Thank you very much for sharing this fix!

Bill Tux gravatar imageBill Tux ( 2018-01-11 10:21:13 -0600 )edit

Question Tools

1 follower


Asked: 2017-01-01 14:17:38 -0600

Seen: 2,342 times

Last updated: Jan 23 '17