Ask Your Question

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

asked 2017-01-01 20:17:38 +0000

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 ( 2017-01-02 17:00:43 +0000 )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 ( 2017-01-02 22:05:33 +0000 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2017-01-24 02:40:10 +0000

hellork gravatar image

updated 2017-01-24 04:27:42 +0000

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 17:01:49 +0000

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-02 04:42:16 +0000

cmurf gravatar image

updated 2017-01-02 04:44:32 +0000

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 ( 2018-01-11 16:21:13 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

1 follower


Asked: 2017-01-01 20:17:38 +0000

Seen: 1,454 times

Last updated: Jan 24 '17