Bug 1575957

Summary: Silverblue installation fails when the EFI partition isn't reformatted
Product: [Fedora] Fedora Reporter: Garrett LeSage <glesage>
Component: ostreeAssignee: Colin Walters <walters>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 39CC: aday, andy.john.richardson, Borskey, butirsky, bz.puckfist, charles.paul, debarshir, douuuglas, dufresnep, edkasp+fedora, hallaj, hudson, itblaked, jlebon, jonathan, jylo06g, miabbott, mike.pk.schmidt, mueller, oholy, sdodson, ssssam, steph, thou.fox, travier, vilgot, walters
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-13 15:12:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
anaconda.log
none
program.log
none
storage.log
none
syslog
none
coredump of ostree admin deploy
none
program.log (failing on grub2-mkconfig)
none
The fix (see Detail) none

Description Garrett LeSage 2018-05-08 12:07:32 UTC
Description of problem:

I attempted to install Fedora 28 Workstation, Silverblue edition (was: Fedora Atomic Workstation) on bare metal, on two different laptops, using Anaconda.

Regardless of the partitioning scheme (with home on /home or /var/home or without home at all), installation failed.


Version-Release number of selected component (if applicable):

Fedora 28 Silverblue @
https://download.fedoraproject.org/pub/fedora/linux/releases/28/AtomicWorkstation/x86_64/iso/Fedora-AtomicWorkstation-ostree-x86_64-28-1.1.iso


How reproducible:

This happens every time, on both a ThinkPad X230 and a Dell XPS 13. 

I tried all sorts of paritioning schemes (including just /boot/, /boot/efi/, and /); also without network, hostname, and timezones changed (originally I modified these, but figured I'd minimize the changes from default).


Steps to Reproduce:
1. Attempt a bare metal installation with existing partitions.


Actual results:

Fatal error, with the following dialog:

===
The following error occurred while installing. This is a fatal error and installation will be aborted.

ostree ['admin', '--sysroot=/mnt/sysimage', 'deploy', '--os=fedora-workstation', 'fedora-workstation:fedora/28/x86_64/workstation'] existed with code -6
===


Expected results:

Installation of Atomic-based Fedora 28.


Additional info:

Same image was used to install successfully in a VM with default partitioning. USB stick was also checked in the installer option.

Twitter thread @ https://twitter.com/garrett/status/993819000005152768

Comment 1 Jonathan Lebon 2018-05-08 17:35:57 UTC
Hmm, we couldn't reproduce this.

> 1. Attempt a bare metal installation with existing partitions.

Did you use the automatic option and then reclaim space? ("Automatic" option, "Reclaim Space" and "Delete All").

If you can, could you boot with inst.nokill=1 and once the installer exits after the error, check if there's more information in program.log?

Comment 2 Colin Walters 2018-05-08 21:55:11 UTC
You can also alt-f2 or so at the error dialog and get a shell with logs.  One trick is to insert a USB stick and copy them there, or upload them to a pastebin if you have internet.

Comment 3 Garrett LeSage 2018-05-09 07:26:25 UTC
I used the normal partitioner.

My computers use normal partitioning, as it doesn't make much sense to use LVM on a laptop.

At one point, I did try the reclaim space method — but it's mostly useless, as I can't identify partitions* in it and I really don't want to nuke the wrong one.

(* The partitions in question are LUKS encrypted and, as a result of a poor decision in the UI, do not show the amount of space used.)

I managed to grab a bunch of logs from the last install I did — I'll attach a few.

Comment 4 Garrett LeSage 2018-05-09 07:27:05 UTC
Created attachment 1433551 [details]
anaconda.log

Comment 5 Garrett LeSage 2018-05-09 07:29:22 UTC
Created attachment 1433553 [details]
program.log

Comment 6 Garrett LeSage 2018-05-09 07:29:53 UTC
Created attachment 1433556 [details]
storage.log

Comment 7 Garrett LeSage 2018-05-09 07:30:24 UTC
Created attachment 1433557 [details]
syslog

Comment 8 Jonathan Lebon 2018-05-09 14:58:55 UTC
So, the interesting bit is:

```
07:40:17,311 INF program: Running... ostree admin --sysroot=/mnt/sysimage deploy --os=fedora-workstation fedora-workstation:fedora/28/x86_64/workstation
07:40:25,419 INF program: Relabeling /var (no stamp file 'var/.ostree-selabeled' found)
07:40:25,420 INF program: **
07:40:25,420 INF program: OSTree:ERROR:src/libostree/ostree-bootloader-grub2.c:354:_ostree_bootloader_grub2_write_config: assertion failed (deployments->len > 0): (0 > 0)
07:40:25,421 DBG program: Return code: -6
```

Not sure what to make of this yet.

Comment 9 Colin Walters 2018-05-09 15:52:35 UTC
Offhand, I think this symptom happens when reusing an existing /boot partition.  Something like the bootloader symlink not being right?

In general supporting the "dual boot with classic" is something where we've hovered at 90% working, but the last 10% details get hard.

Comment 10 Thomas Mueller 2018-05-10 17:45:51 UTC
Created attachment 1434481 [details]
coredump of ostree admin deploy

I've ran into the same issue. I tried to replace my Fedora 28 workstation with Silverblue.

I saw the bootloader_grub2_write_config error, removed /boot/efi/EFI/fedora and tried to install again. no luck. same error.

Comment 11 Thomas Mueller 2018-05-10 17:48:47 UTC
"tried to replace": I ran the ISO installer from USB and re-formatted every partition but the home data partition.

Comment 12 Jonathan Lebon 2018-05-10 17:50:28 UTC
This is a shot in the dark, though could you check if /boot/loader/grub.cfg exists, and if so then delete/rename it. OSTree uses this file to determine whether the system is BIOS or EFI.

Comment 13 Thomas Mueller 2018-05-10 18:13:44 UTC
Created attachment 1434498 [details]
program.log (failing on grub2-mkconfig)

/boot/loader/grub.cfg did not exist. 

But there was /boot/efi/EFI/ubuntu which contained a grub.cfg (its a dell notebook which was pre-installed with Ubuntu). I've now removed this one too.

And now according /tmp/program.log the ostree admin deploy command succeeds.

but fails with another issue:

```
14:05:49,452 INF program: Running in chroot '/mnt/sysimage/ostree/deploy/fedora-workstation/deploy/ef3d3262fe9c62d20e18637d656943a285530363060696ece175f2313683003d.0'... grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
14:05:49,901 INF program: /usr/bin/grub2-editenv: error: cannot rename the file /boot/grub2/grubenv.new to /boot/grub2/grubenv: No such file or directory.
14:05:49,902 INF program: /sbin/grub2-mkconfig: line 249: /boot/efi/EFI/fedora/grub.cfg.new: No such file or directory
```

/boot/grub2/grubenv is a symlink to /boot/efi/EFI/fedora/grubenv and the /boot/efi/EFI/fedora directory does not exist.

Comment 14 Thomas Mueller 2018-05-10 18:25:45 UTC
running `mkdir /mnt/sysimge/boot/efi/EFI/fedora` and then again re-installing made the installer complete. 

but the system won't boot. I don't think grub was installed correctly.

Comment 15 Thomas Mueller 2018-05-10 20:12:40 UTC
the grub EFI issue is that the binaries are copied to /boot/efi/EFI/EFI instead to /boot/efi/EFI. sounds like "cp -R /usr/lib/ostree-boot/efi/EFI /boot/efi/EFI" which then creates /boot/efi/EFI/EFI.

Comment 16 thou.fox 2018-05-11 15:25:10 UTC
Can confirm with same error
Installation fails with

18:15:16,461 INF program: OSTree:ERROR:src/libostree/ostree-bootloader-grub2.c:354:_ostree_bootloader_grub2_write_config: assertion failed (deployments->len > 0): (0 > 0)
18:15:16,461 DBG program: Return code: -6

Just creating new / ext4 partition and providing existing boot/efi, because other OSes live on notebook

Comment 17 Jiri Konecny 2018-10-04 10:38:09 UTC
*** Bug 1635514 has been marked as a duplicate of this bug. ***

Comment 18 Andy Richardson 2018-10-24 18:05:40 UTC
Also having this issue.

Just to clarify - this occurs despite using a cleanly formatted /boot partition and removing the existing Fedora EFI entry at /boot/efi/EFI/fedora.

Comment 19 charles.paul 2019-01-04 09:31:18 UTC
This bug is preventing me from installing Silverblue --  I am also installing to a fresh boot partition.

Comment 20 jkliop 2019-02-21 10:38:12 UTC
I ran into this as well when trying to install Silverblue on a machine that was previously booting both Fedora28 and Windows 10.

I didn't try to preserve anything from the old Fedora28 install -- I reclaimed the old fedora boot partition. However, I did not reclaim the EFI partition (as I don't want to do anything that might break that system's Windows install). The old boot/efi contents are present in /mnt/sysimage/boot/efi/EFI/fedora during the install process, including my grub.cfg file from Fedora 28.

I tried moving the old fedora folder aside and manually attempting to ostree admin deploy, but it did not help -- I still get the same error.

Comment 21 jkliop 2019-02-22 08:26:14 UTC
I was eventually able to get it installed.

I tried a number of different things -- I was able to make some progress (getting past the ostree-admin deploy fatal error), but ultimately continued to run into problems where it wouldn't generate a bootable fedora installation.
I tried manually fixing it with chroot, but ran into some difficulties.

However, what did work was simply doing manual partitioning, and creating an entirely new EFI partition. I have one EFI filesystem used by Windows (with some remnants from my old Fedora install), and an entirely separate one for Silverblue. Afterwards, the install worked fine. The only drawback I can see is losing like 100 MiB of disk space, which is fairly trivial.

Comment 22 Ben Cotton 2019-05-02 19:52:26 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 23 Debarshi Ray 2019-05-13 10:18:06 UTC
I am getting this same error with the Silverblue 30 installer.

This laptop earlier had Silverblue 28 on it with a separate /var/home. Initially I tried installing by reformating every partition except /var/home and the EFI partition, but that failed with this error. Then I tried wiping all partitions and re-creating from scratch which again ran into this error.

Comment 24 Debarshi Ray 2019-05-13 10:34:20 UTC
Since this wasn't a dual boot, but just an attempt to do a clean Silverblue 30 installation over SB28, my workaround was to ensure that the EFI partition was reformatted.

Apparently, earlier, even when I had told Anaconda to re-create all the partitions from scratch, it wasn't reformatting the EFI partition.

Comment 25 Andrey 2020-02-20 14:51:18 UTC
(In reply to Thomas Mueller from comment #15)
> the grub EFI issue is that the binaries are copied to /boot/efi/EFI/EFI
> instead to /boot/efi/EFI. sounds like "cp -R /usr/lib/ostree-boot/efi/EFI
> /boot/efi/EFI" which then creates /boot/efi/EFI/EFI.

Seems this is a culprit of the problem. Anybody tried to find the place in the code where it happens?

Comment 26 Andrey 2020-02-21 14:20:58 UTC
The fix:
https://github.com/rhinstaller/anaconda/pull/2329

Comment 27 Andrey 2020-03-12 21:46:04 UTC
that PR above solves part of the problem - it will work when first OS doesn't use grub for boot (i.e Windows).
If grub.cfg exists in EFI directory of the first OS - there is still error at install time.

Comment 28 Ben Cotton 2020-04-30 20:21:11 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 29 Andrey 2020-04-30 21:05:20 UTC
Please, change the version - it still present on Fedora SB 31, and probably 32 too, since the fix was not merged.

Comment 30 Scott Dodson 2020-04-30 21:12:42 UTC
I know it's there in 31 but I've not done a new install of 32 so bumping to 31. Someone else can confirm it's still there in 32 and bump it further.

Comment 31 Vilgot Fredenberg 2020-05-13 14:50:58 UTC
I can confirm that this bug is still present in SB 32

Comment 32 Mike Schmidt 2020-05-23 01:18:53 UTC
I can confirm it's still there in the SB 32 release version.

Comment 33 Edmund Kasprzak 2020-05-24 19:20:23 UTC
I can also confirm bug is there in SB 32 downloaded today.

Comment 34 Edmund Kasprzak 2020-05-24 19:49:00 UTC
Also confirmed for SB 33 using: 
Fedora-Silverblue-ostree-x86_64-Rawhide-20200524.n.0.iso

Comment 35 Andrey 2020-05-25 01:38:36 UTC
Created attachment 1691672 [details]
The fix (see Detail)

Comment 37 Andrey 2020-05-25 01:46:57 UTC
Comment on attachment 1691672 [details]
The fix (see Detail)

https://bugzilla.redhat.com/show_bug.cgi?id=1575957#c26

Comment 38 Andrey 2020-07-13 19:39:17 UTC
(In reply to Andrey from comment #26)
> The fix:
> https://github.com/rhinstaller/anaconda/pull/2329

FYI, it's merged now.

Comment 39 Ben Cotton 2020-11-03 15:00:42 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 40 Timothée Ravier 2020-11-03 16:12:06 UTC
Bumping to 32. Can someone confirm this is fixed in 33? Thanks!

Comment 41 Thomas Mueller 2020-11-13 13:51:06 UTC
Still the very same issue with Fedora Silverblue 33 if you don't reformat the EFI partition (I still don't know if formatting EFI is something I should do or not). If the target folder /boot/efi/EFI exists while installing, the installer aborts with a error that "ostree admin --sysroot=/mnt/sysimage deploy ..." exited with 1. running the command with "--verbose" says "grub2-mkconfig" failed.

Workaround: 
* after creating the disk partitioning and before starting the installation process
* switch to a shell (Ctrl-Alt-F2)
* mount the EFI partition somewhere
* rename the EFI folder
* umount
* start installation process.

Comment 42 Andrey 2020-11-13 18:08:57 UTC
Thanks Thomas for trying it.
We had two issues here with similar symptoms, and you faced with not the one I fixed.
IIRC, as a workaround you could also just rename existing grub's config file in EFI dir.
It would be good if you could confirm.

I'm not familiar with that problem details, hopefully someone can say more.
Please, bump to 33.

Comment 43 Henrique Ferreiro 2020-11-30 11:12:47 UTC
This is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1483818.

Comment 44 Fedora Program Management 2021-04-29 15:54:09 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 45 James Baxter 2021-05-20 16:18:58 UTC
This is still a problem in Fedora 34

Comment 46 James Baxter 2021-06-23 12:35:18 UTC
(In reply to Thomas Mueller from comment #41)
> Workaround: 
> * after creating the disk partitioning and before starting the installation
> process
> * switch to a shell (Ctrl-Alt-F2)
> * mount the EFI partition somewhere
> * rename the EFI folder
> * umount
> * start installation process.

Direct commands after partitioning, before "Begin installation":
# mkdir /boot-temp
# mount /dev/sda1 /boot-temp
# rm -r /boot-temp/EFI/fedora
# umount /boot-temp

Then Ctrl+Alt+F6 to return to installation menu. Begin the installation.


---

This applies if you're trying to install a single Fedora installation over another Fedora installation.

Comment 47 Ben Cotton 2021-08-10 12:45:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 48 Stephane Travostino 2022-06-07 08:14:53 UTC
Still a problem on Fedora Silverblue 36

Comment 49 Douglas Moura 2022-10-11 22:28:49 UTC
(In reply to James Baxter from comment #46)
> (In reply to Thomas Mueller from comment #41)
> > Workaround: 
> > * after creating the disk partitioning and before starting the installation
> > process
> > * switch to a shell (Ctrl-Alt-F2)
> > * mount the EFI partition somewhere
> > * rename the EFI folder
> > * umount
> > * start installation process.
> 
> Direct commands after partitioning, before "Begin installation":
> # mkdir /boot-temp
> # mount /dev/sda1 /boot-temp
> # rm -r /boot-temp/EFI/fedora
> # umount /boot-temp
> 
> Then Ctrl+Alt+F6 to return to installation menu. Begin the installation.
> 
> 
> ---
> 
> This applies if you're trying to install a single Fedora installation over
> another Fedora installation.

I can't install Fedora Silverblue 36 because of this bug.
The mentioned workaround doesn't work for me, there is no /boot-temp/EFI/fedora file.

Comment 50 James Baxter 2022-10-13 16:02:03 UTC
This _should_ work, but you might have to change the /dev/sda1 to your boot partition which might be named something else like /dev/nvmep1

Check the partitions with `lsblk` or `ls /dev/`

Comment 51 Ben Cotton 2022-11-29 16:45:36 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 52 Ben Cotton 2022-12-13 15:12:31 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 53 Trammell Hudson 2024-01-27 09:50:38 UTC
I installed Fedora Sericea successfully, bounced off of Sway, and then attempted to install Silverblue 39 and ran into the same error.  Having a footnote in a doc about it (https://docs.fedoraproject.org/en-US/fedora-silverblue/troubleshooting/#_unable_to_install_fedora_silverblue_on_efi_systems) is helpful, but finding it *after* things have gone wrong isn't the best.

My solution was to hit Control-Alt-F2 to get a recovery shell, rm -rf /mnt/sysroot/boot/efi/efi/fedora and then reboot for another install attempt which worked.

Comment 54 Sam Thursfield 2024-04-04 22:35:40 UTC
Issue still present in Fedora Silverblue 39 installer. Reproduced on a laptop with Windows 10 Home installed. The workaround "Reformat the EFI partition on the host during the install process." worked for me.

Comment 55 Debarshi Ray 2024-04-05 00:42:20 UTC
Reopening.

Comment 56 Sam Thursfield 2024-04-05 18:05:47 UTC
Clarification on the above, the sequence of events was this:

 0. Laptop has Windows 10 Home installed
 1. Install Fedora SB40 Beta, which installed successfully, but did not boot - on reboot it went straight to emergency mode.
 2. Install Fedora SB39, which failed to install due to `ostree admin deploy` failure
 3. Retry install, setting "Reformat" option on EFI partition, which succeeded.