Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt fails with error "removing ".btmp.fedora/mmia32.efi": No such file or directory (os error 2)" #762

Open
jorgeml opened this issue Nov 4, 2024 · 8 comments · May be fixed by #765
Open

Comments

@jorgeml
Copy link

jorgeml commented Nov 4, 2024

On a X86-84 system running Fedora Silverblue 41:

$ sudo bootupctl status
Running as unit: bootupd.service
No components installed.
Detected: EFI: unknown
Boot method: EFI

$ sudo bootupctl adopt-and-update
Running as unit: bootupd.service
error: Failed adopt and update: applying filesystem changes: removing ".btmp.fedora/mmia32.efi": No such file or directory (os error 2)

$ sudo bootupctl --version
bootupctl 0.2.24

@HuijingHei
Copy link
Member

Thanks for the reports.

Does this mean you have upgraded the OS from older version to Fedora Silverblue 41 latest?

Which version are you using for Fedora Silverblue 41? As I remembered, the latest version includes bootloader-update.service, which should automatically update bootloader during booting after upgrade, so you might do not need to update manually.

@jorgeml
Copy link
Author

jorgeml commented Nov 5, 2024

Thanks @HuijingHei ! Yes, this was an upgraded system. I have been running Silverblue for a few releases.

I updated to the latest Silverblue compose (41.20241105.0 (2024-11-05T00:40:00Z)) and the error has changed:

$ sudo bootupctl adopt-and-update
Running as unit: bootupd.service
error: Failed adopt and update: applying filesystem changes: removing ".btmp.BOOT/fbia32.efi": No such file or directory (os error 2)

$ sudo bootupctl validate
Running as unit: bootupd.service
No components installed.

@HuijingHei
Copy link
Member

HuijingHei commented Nov 6, 2024

I can not reproduce when I upgrade to 41.20241105.0, maybe there is something different with your env, could you help to output your lsblk result, and sudo bootupctl adopt-and-update -vvvv would provide more detail info? Thanks!

fedora@fedora:~$ journalctl -b -u bootloader-update.service --no-page
Nov 06 01:32:38 fedora systemd[1]: Starting bootloader-update.service - Update bootloader on boot...
Nov 06 01:32:38 fedora bootupctl[920]: Adopted and updated: EFI: grub2-efi-ia32-1:2.12-10.fc41.x86_64,grub2-efi-x64-1:2.12-10.fc41.x86_64,shim-ia32-15.8-3.x86_64,shim-x64-15.8-3.x86_64
Nov 06 01:32:38 fedora systemd[1]: Finished bootloader-update.service - Update bootloader on boot.
fedora@fedora:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
zram0  251:0    0  3.8G  0 disk [SWAP]
vda    252:0    0   20G  0 disk 
├─vda1 252:1    0  600M  0 part /boot/efi
├─vda2 252:2    0    1G  0 part /boot
└─vda3 252:3    0 18.4G  0 part /var/home
                                /var
                                /sysroot/ostree/deploy/fedora/var
                                /usr
                                /etc
                                /
                                /sysroot

@travier
Copy link
Member

travier commented Nov 6, 2024

The listing of /boot/efi might also help us: sudo ls -alhR /boot/efi

@jorgeml
Copy link
Author

jorgeml commented Nov 6, 2024

@HuijingHei

$ journalctl -b -u bootloader-update.service --no-page
Nov 06 17:33:47 deneb systemd[1]: Starting bootloader-update.service - Update bootloader on boot...
Nov 06 17:33:47 deneb bootupctl[1222]: error: Failed adopt and update: applying filesystem changes: removing ".btmp.BOOT/BOOTIA32.EFI": No such file or directory (os error 2)
Nov 06 17:33:47 deneb systemd[1]: bootloader-update.service: Main process exited, code=exited, status=1/FAILURE
Nov 06 17:33:47 deneb systemd[1]: bootloader-update.service: Failed with result 'exit-code'.
Nov 06 17:33:47 deneb systemd[1]: Failed to start bootloader-update.service - Update bootloader on boot.
$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 465.8G  0 disk 
├─sda1        8:1    0   100M  0 part 
├─sda2        8:2    0    16M  0 part 
├─sda3        8:3    0 232.1G  0 part 
└─sda4        8:4    0   715M  0 part 
sdb           8:16   0 931.5G  0 disk 
sdc           8:32   0 931.5G  0 disk 
zram0       252:0    0     8G  0 disk [SWAP]
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   600M  0 part /boot/efi
├─nvme0n1p2 259:2    0     1G  0 part /boot
└─nvme0n1p3 259:3    0 929.9G  0 part /var/home
                                      /var
                                      /sysroot/ostree/deploy/fedora/var
                                      /usr
                                      /etc
                                      /
                                      /sysroot

@travier

$ sudo ls -alhR /boot/efi
/boot/efi:
total 12K
drwx------. 3 root root 4.0K Jan  1  1970 .
drwxr-xr-x. 7 root root 4.0K Nov  6 17:33 ..
drwx------. 5 root root 4.0K Nov  6 17:33 EFI

/boot/efi/EFI:
total 20K
drwx------. 5 root root 4.0K Nov  6 17:33 .
drwx------. 3 root root 4.0K Jan  1  1970 ..
drwx------. 2 root root 4.0K Sep  9  2022 BOOT
drwx------. 2 root root 4.0K Sep  9  2022 .btmp.BOOT
drwx------. 2 root root 4.0K Nov  6 17:36 fedora

/boot/efi/EFI/BOOT:
total 1.0M
drwx------. 2 root root 4.0K Sep  9  2022 .
drwx------. 5 root root 4.0K Nov  6 17:33 ..
-rwx------. 1 root root 928K Apr 10  2024 BOOTX64.EFI
-rwx------. 1 root root  86K Apr 10  2024 fbx64.efi

/boot/efi/EFI/.btmp.BOOT:
total 1.0M
drwx------. 2 root root 4.0K Sep  9  2022 .
drwx------. 5 root root 4.0K Nov  6 17:33 ..
-rwx------. 1 root root 928K Apr 10  2024 BOOTX64.EFI
-rwx------. 1 root root  86K Apr 10  2024 fbx64.efi

/boot/efi/EFI/fedora:
total 6.5M
drwx------. 2 root root 4.0K Nov  6 17:36 .
drwx------. 5 root root 4.0K Nov  6 17:33 ..
-rwx------. 1 root root  110 Apr 10  2024 BOOTX64.CSV
-rwx------. 1 root root 8.1K Nov  6 17:33 grub.cfg
-rwx------. 1 root root 8.1K Nov  5 17:55 grub.cfg.old
-rwx------. 1 root root 1.0K Nov  6 17:36 grubenv
-rwx------. 1 root root 3.8M Apr 10  2024 grubx64.efi
-rwx------. 1 root root 829K Apr 10  2024 mmx64.efi
-rwx------. 1 root root 928K Apr 10  2024 shim.efi
-rwx------. 1 root root 928K Apr 10  2024 shimx64.efi

@jorgeml
Copy link
Author

jorgeml commented Nov 6, 2024

Sorry, forgot this one:

$ sudo bootupctl adopt-and-update -vvvv
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] No saved state
[TRACE bootupd::bootupd] Remaining known components: 2
[DEBUG bootupd::bios] Skip BIOS adopt
[TRACE bootupd::bootupd] Not adoptable: BIOS
[DEBUG bootupd::efi] Reusing existing "/boot/efi"
[TRACE bootupd::efi] No EFI variable LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::efi] No EFI variable StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::efi] Unmounting
[DEBUG bootupd::efi] Reusing existing "/boot/efi"
[TRACE bootupd::efi] No EFI variable LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::efi] No EFI variable StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::efi] Reusing existing "/boot/efi"
[DEBUG bootupd::efi] Reusing existing "/boot/efi"
[TRACE bootupd::efi] applying adoption diff: additions: 0 removals: 6 changes: 1
[DEBUG bootupd::filetree] Copy fedora to .btmp.fedora
[DEBUG bootupd::efi] Unmounting
error: Failed adopt and update: applying filesystem changes: removing ".btmp.fedora/shimia32.efi": No such file or directory (os error 2)

@HuijingHei
Copy link
Member

/boot/efi/EFI/BOOT:
total 1.0M
drwx------. 2 root root 4.0K Sep 9 2022 .
drwx------. 5 root root 4.0K Nov 6 17:33 ..
-rwx------. 1 root root 928K Apr 10 2024 BOOTX64.EFI
-rwx------. 1 root root 86K Apr 10 2024 fbx64.efi

/boot/efi/EFI/fedora:
total 6.5M
drwx------. 2 root root 4.0K Nov 6 17:36 .
drwx------. 5 root root 4.0K Nov 6 17:33 ..
-rwx------. 1 root root 110 Apr 10 2024 BOOTX64.CSV
-rwx------. 1 root root 8.1K Nov 6 17:33 grub.cfg
-rwx------. 1 root root 8.1K Nov 5 17:55 grub.cfg.old
-rwx------. 1 root root 1.0K Nov 6 17:36 grubenv
-rwx------. 1 root root 3.8M Apr 10 2024 grubx64.efi
-rwx------. 1 root root 829K Apr 10 2024 mmx64.efi
-rwx------. 1 root root 928K Apr 10 2024 shim.efi
-rwx------. 1 root root 928K Apr 10 2024 shimx64.efi

Thanks for the testing, this is helpful. Seems the system does not have shim-ia32 and grub2-efi-ia32, but this is expected as we do not need it on x64, if remove the related file, the update would fail

root@fedora:/boot/efi/EFI# ls BOOT/
BOOTIA32.EFI  BOOTX64.EFI   fbia32.efi    fbx64.efi     
root@fedora:/boot/efi/EFI# rm -f BOOT/fbia32.efi BOOT/BOOTIA32.EFI
root@fedora:~# bootupctl adopt-and-update
Running as unit: bootupd.service
error: Failed adopt and update: applying filesystem changes: removing ".btmp.BOOT/fbia32.efi": No such file or directory (os error 2)

We need to ignore the removing if can not find the file, also curious how we could remove shim-ia32 and grub2-efi-ia32 packages, maybe remove directly the related files under /boot/efi ?

HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Nov 7, 2024
@jorgeml
Copy link
Author

jorgeml commented Nov 7, 2024

Thanks @HuijingHei ! I think I might have caused this when fixing a boot error a year or two ago, one of those which had an article in Fedora Magazine. I will wait for the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants