Bug 1823104 - Installation of 31 and 32beta fail with: failed to write boot loader configuration
Summary: Installation of 31 and 32beta fail with: failed to write boot loader configur...
Keywords:
Status: CLOSED DUPLICATE of bug 1814690
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-11 17:28 UTC by Giuseppe Castagna
Modified: 2020-06-16 16:07 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-05-06 15:53:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
anaconda trace (2.63 MB, image/jpeg)
2020-05-01 15:14 UTC, Robert
no flags Details

Description Giuseppe Castagna 2020-04-11 17:28:44 UTC
Description of problem:

Doing a fresh installation on a dual boot (Win10) X1 Carbon 3rd Gen
fails with the message

"failed to write boot loader configuration"

Version-Release number of selected component (if applicable):
It happens both with Fedora Workstation Live 31 and 32 beta


How reproducible:


Steps to Reproduce:
1. Try to install Fedora 31 or 32 beta from Live Usb on a Fedora 30 (upgraded from fresh f29)
2. reuse /home /usr/local and /boot/efi and reformat / /boot and swap
3. start installation

Actual results:

Fails with "failed to write boot loader configuration"


In anaconda.log there are the following errors:

ERR bootloader.grub2: failed to set menu_auto_hide=1
ERR bootloader.installation: bootloader.write failed: failed to write boot loader 


Expected results:

Installation should succeed :-)


Additional info:

This clearly is a problem with Fedora 31 and 32beta. Installing a fresh
Fedora 29 and then yum-upgrading to 31 works. I did not try Fedora 30 but I found a similar bug report for Fedora 30 on askfedora: https://ask.fedoraproject.org/t/failed-to-write-boot-loader-configuration-fedora-30-uefi-dual-boot-with-win10/1162

Comment 1 Giuseppe Castagna 2020-04-11 17:55:23 UTC
Installing a fresh Fedora 29 and then yum-upgrading to 31 works ... mostly.

I had to manually update the grub menu by

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

Comment 2 Vendula Poncova 2020-04-14 11:54:43 UTC
Please, attach all logs (including syslog) from the installation. You can find them during the installation in /tmp.

Comment 3 Giuseppe Castagna 2020-04-14 14:14:45 UTC
I am sorry, but this is my working machine and I installed the fedora 31 without keeping the logs and won't redo the installation again from scratch since it took me one day. You can close this report ... but the bug is there.

Comment 4 Robert 2020-05-01 15:14:02 UTC
Created attachment 1683711 [details]
anaconda trace

Comment 5 Robert 2020-05-01 15:25:58 UTC
Ran into the same problem. Dual boot system, where I had deleted the Linux partitions (after backing up my home dir) due to another bug (https://bugzilla.redhat.com/show_bug.cgi?id=1812727)

"The following error occurred while installing the boot loader. The system will not be bootable. Would you like to ignore this and continue with installation?"
With the error being "failed to write boot loader configuration"

With anaconda still waiting on my response if it should continue, i first found the real error in the logs (picture attached)

And since I have done a couple of F32 installations and had already seen this error I know the solution.

I opened another terminal and ran the following commands:

sudo chroot /mnt/sysroot
grub2-editenv create
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
exit
exit

And told anaconda to continue the installation. Afterwords the system was able to boot normally.

They key thing to solving it was running "grub2-editenv create", as by default the file is 0 bytes.

Comment 6 Giuseppe Castagna 2020-05-01 16:00:18 UTC
@Robert. Nice to know, thanks, I'll try it when upgrading to the 32 (I do as you do, rather than upgrading I save home and do a new installation from scratch).

For those who should run on the same problem, the reason why I had to update manually grub.cfg (the first time and every time I updated the kernel) is because F29 had the following option
GRUB_ENABLE_BLSCFG
set to false in /etc/default/grub. Setting it to true solved the problem of updating grub.cfg manually.

Comment 7 Vendula Poncova 2020-05-06 15:53:23 UTC

*** This bug has been marked as a duplicate of bug 1814690 ***

Comment 8 Robert 2020-05-06 16:18:40 UTC
Great... Marked duplicate of a confidential bug, so we cannot see what is going on.

Comment 9 Vendula Poncova 2020-05-06 16:44:04 UTC
Sorry about that, you should be able to see it now.

Comment 10 Igor 2020-06-05 12:12:09 UTC
Still not possible to see ticket.

You are not authorized to access bug #1814690.

Most likely the bug has been restricted for internal development processes and we cannot grant access.

Comment 11 Vendula Poncova 2020-06-16 16:07:07 UTC
The bug was reassigned to grub2 and closed as NEXTRELEASE.

From Javier Martinez Canillas:

So the problem is that the /boot/grub2/grubenv file is not valid. This usually happens when this file is not modified using the grub2-editenv tool. The reason why it must be modified using this tool is that the GRUB tools are very strict on how the file size and content (it's size must be 1024 and be padded with # characters).

What I suggest is to re-create this file on the first installed system with:

$ grub2-editenv create

and just to be safe, you may also re-generate your grub.cfg file with:

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

Then the installation should succeed since the grubenv file will be valid.

For F33 we are changing the configuration and instead of storing the kernel cmdline in the grubenv file, these will be stored in the BLS snippets so there won't be a need to call grub2-editenv from grub2-mkconfig anymore.

So I think that there's nothing to be done in Anaconda for this since F32 was already released and the issue won't happen anymore in F33 due changes in the grub2 package.


Note You need to log in before you can comment on or make changes to this bug.