composefs: bootc status/upgrade/switch use the first ESP on the disk instead of the one the system booted from (dual-boot with Windows)
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Symptom
On a dual-boot machine (Windows + bootc composefs, systemd-boot), every storage-touching verb fails:
$ sudo bootc status
error: Status: Prepending custom prefix to EFI and BLS entries: Getting sorted Type1 boot entries: No such file or directory (os error 2)
The system itself boots fine from the correct ESP.
Environment
- bootc 1.16.9, composefs backend, systemd-boot 257.13 (Debian 13 trixie)
- UEFI, Secure Boot disabled
- One NVMe disk, GPT, two ESPs:
NAME FSTYPE PARTTYPENAME SIZE PARTUUID
nvme0n1p1 vfat EFI System 100M e5ff1c7b-ad03-4765-b4b8-508d7c0ac2bc <- Windows/HP ESP (EFI/Boot, EFI/HP, EFI/Microsoft)
nvme0n1p2 Microsoft reserved 16M
nvme0n1p3 ntfs Microsoft basic data 276.1G
nvme0n1p4 ntfs Windows recovery environment 743M
nvme0n1p5 vfat EFI System 1G 124d3e1f-7290-4cba-8cd1-cbfe0532c383 <- Linux ESP (EFI/systemd, EFI/Linux, loader/entries)
nvme0n1p6 crypto_LUKS Linux root (x86-64) 199G
bootctl status confirms systemd-boot was loaded from p5:
Partition: /dev/disk/by-partuuid/124d3e1f-7290-4cba-8cd1-cbfe0532c383
Loader: └─/EFI/systemd/systemd-bootx64.efi
p5 contains the expected bootc layout (loader/entries/bootc_debian-13-1.conf, EFI/Linux/bootc_composefs-<digest>/{vmlinuz,initrd}), matching the booted composefs= karg. p1 has no loader/ directory.
Trace
$ sudo RUST_LOG=trace bootc status
...
TRACE exec: "lsblk" "-J" "-b" "-O" "/dev/nvme0n1"
TRACE exec: "findmnt" "-J" "-v" "--output=SOURCE,TARGET,MAJ:MIN,FSTYPE,OPTIONS,UUID"
DEBUG find_mount_target_by_source: no mount found for source /dev/nvme0n1p1; ...
error: Status: Prepending custom prefix to EFI and BLS entries: Getting sorted Type1 boot entries: No such file or directory (os error 2)
bootc selects /dev/nvme0n1p1 (the Windows ESP). Mounting p5 at /boot, /sysroot/boot or /sysroot/boot/efi beforehand does not change the outcome.
Root cause
Device::find_partition_of_esp_optional() in crates/blockdev/src/blockdev.rs returns the first partition with the ESP type GUID. With more than one ESP on the disk, that is not necessarily the one in use. This still appears to be the case on main.
Related
- #1929: the same first-ESP selection affects
bootc install to-filesystem. #1953 addresses that by using the mounted/boot/efi, but it only covers the install path, not runtimestatus/upgrade/switch. - #2375: same error message, different cause (non-EFI boot).
Suggested fix
On a running UEFI system, prefer the ESP identified by the LoaderDevicePartUUID EFI variable (set by systemd-boot and other loaders implementing the Boot Loader Interface), and fall back to the first ESP only when that variable is absent. Optionally also honour an ESP mounted at /boot, /efi or /boot/efi.
Workaround
Changing the Windows ESP's partition type away from "EFI System" would presumably make bootc pick p5 (as reported in #1929), but that risks breaking Windows boot, so it isn't a real option for dual-boot users.
- 主要语言
- Rust
- 星标
- 2.3k
- 派生
- 230
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 56
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bootc-dev/bootc 的其他 Issue
-
install: root SSH tmpfiles.d drop-in is labeled etc_runtime_t instead of etc_t可能已有人在做 @andrewdunndev 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
auto-updates fail with `opendir(boot): Operation not permitted` when /boot is a systemd automount that has idled out可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭triaged
难度 2/5 1-3 小时 新手友好度 70/100
bootc-dev/bootc#2402 · 9 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
install: improve error message when systemd-boot is selected without composefs backend可能已有人在做 @ASVLCII 于 27 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcome未关闭type:debt
难度 2/5 1-3 小时 新手友好度 62/100
skaiy/wild_agentos#425 ·
维护者通常 1 天内回复
-
Default-import note suggests `import * as process` for velt:process, which does not name the builtin未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug ticket
难度 2/5 1-3 小时 新手友好度 72/100
cratestack/cratestack#1154 ·
维护者通常 1 天内回复
-
status:needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
agentic-os-org/ANOLISA#6742 · 1 条评论 ·
维护者通常 1 天内回复