omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Dual-boot install creates a redundant ESP instead of reusing the existing Windows one, and `omarchy-refresh-limine` permanently drops the Windows entry on every run

Open ThePeteJames opened this issue 3 months ago • 6 comments

System details

$ omarchy version
4.0.0-1
$ limine --version
Limine 12.5.2
$ pacman -Q limine-snapper-sync
limine-snapper-sync 1.31.0-1

Single NVMe drive, UEFI, Secure Boot disabled. Existing Windows 11 install with its own ESP, installing Omarchy "alongside existing data" into free space on the same disk.

What's wrong

Two separate, independently-confirmed bugs, compounding into "Windows disappears from the boot menu after a dual-boot install":

1. The installer ignores the existing Windows ESP and creates its own new one.

Partition layout before install:

nvme0n1p1 — Windows ESP, VFAT, ~100 MB (EFI/Microsoft, EFI/BOOT) — the ESP firmware actually boots from
nvme0n1p2 — Microsoft Reserved
nvme0n1p3 — Windows
nvme0n1p4 — Windows Recovery

After choosing "install alongside existing data" into the free space, the installer created a new 2 GB ESP (nvme0n1p5, label omarchy-efi) and installed Limine there, rather than adding an entry to the existing p1 ESP. The new ESP's Limine install registered a firmware boot entry, but not one the firmware surfaced in its top-level boot list — it only showed up buried in a vendor-specific submenu ("UEFI NVMe Drive BBS Priorities"). Net effect: the machine booted straight to Windows with no visible way in.

This reproduced identically on a second from-scratch install (first attempt's partitions were wiped and redone) — same free-space option, same result: a second orphaned 2 GB ESP. Not a one-off.

Recovering from this required manually chrooting in, reinstalling Limine, and repointing /etc/fstab's /boot mount from the stray p5 ESP to the real p1 Windows ESP — plus later deleting the now-duplicate, unmanaged Limine boot entry on p5 via efibootmgr once it was clear the firmware was booting the wrong (stale) one.

2. omarchy-refresh-limine unconditionally destroys any Windows entry and never restores it.

/usr/share/omarchy/bin/omarchy-refresh-limine:

sudo mv /boot/limine.conf /boot/limine.conf.bak
sudo cp "$OMARCHY_PATH/default/limine/limine.conf" /boot/limine.conf
sudo limine-update
sudo limine-snapper-sync

The template it copies in ($OMARCHY_PATH/default/limine/limine.conf) contains zero OS/boot entries — only theming. limine-update only reinstalls the Limine binary and regenerates Linux kernel/UKI entries (limine-install --no-efi-register + limine-mkinitcpio); limine-snapper-sync only manages Btrfs-snapshot entries. Neither calls limine-scan / limine-entry-tool --scan, which is the only mechanism that detects and chainloads bootmgfw.efi.

So any Windows entry present in limine.conf — whether added by the installer's own scan pass or by a user running limine-scan manually — is silently and permanently discarded the next time omarchy-refresh-limine runs, and nothing downstream re-adds it. Confirmed by diffing the live /boot/limine.conf (Windows entry present) against /boot/limine.conf.bak (only the bare EFI fallback entry, no Windows, no Omarchy) — the .bak is exactly what the wipe-then-partial-rebuild leaves behind.

This is the same class of bug fixed for the factory-reset path in #6847 (wholesale limine.conf overwrite dropping foreign entries) — but that PR only touches bin/omarchy-system-factory-reset, not omarchy-refresh-limine, so this code path is still affected.

What was expected

  • Installing alongside an existing Windows install should reuse the existing ESP (or at minimum warn/prompt when a usable one is already present) rather than silently creating a second one that firmware may not surface.
  • omarchy-refresh-limine should not destroy manually- or installer-scanned foreign OS entries. Either preserve existing non-Omarchy blocks when rewriting the file, or re-run limine-scan as part of the refresh so they're rebuilt rather than dropped.

Steps to reproduce

  1. Have an existing Windows 11 install with its own ESP on a single-disk UEFI machine.
  2. Install Omarchy via the "install alongside existing data" free-space option.
  3. Observe a new, separate ESP is created rather than the existing Windows one being used; Windows is missing from the boot menu.
  4. (Separately) On a system with a working Windows entry in limine.conf, run sudo omarchy-refresh-limine, then check /boot/limine.conf — the Windows entry is gone.

Possibly related

  • #7515 — free-space install doesn't work alongside non-OS partitions
  • #4579 — dual-boot install, Windows entry missing from Limine/UEFI (different disk layout, same symptom family)
  • #1401 — installing from omarchy-online.iso wipes the Windows 11 boot entry (closed, no visible fix — may be a regression if this still reproduces)
  • #6847 — fixes the same "unconditional limine.conf overwrite drops foreign entries" bug class, but only for factory-reset, not omarchy-refresh-limine

Filed by Claude (Sonnet 5) via Claude Code.

ThePeteJames avatar Aug 23 '26 08:08 ThePeteJames

Same problem family here, on totally different hardware — 2015 MacBook Pro (MacBookPro11,4), Apple UEFI, single SATA/AHCI disk (/dev/sda), Windows 10. Windows is on its original 100MB ESP (sda1); Omarchy/Limine is on a separate 2GB ESP (sda5, OMARCHY_EFI). So this is not NVMe-specific. Both bugs repro:

  • Redundant ESP — the "alongside existing data" install made a new 2GB ESP (sda5, OMARCHY_EFI) and left the existing 100MB Windows ESP (sda1) untouched; it also did not add a Windows entry to Limine.
  • omarchy-refresh-limine — confirmed it drops the Windows entry. The template it copies in has no OS entries, and nothing after it runs limine-scan, so the entry is just gone.

On this Mac, the separate-ESP install was compounded by stale Fedora/Debian loaders left on the Windows ESP — its EFI/BOOT/BOOTX64.EFI was a dead Fedora shim. Apple’s Option-key picker follows EFI/BOOT/BOOTX64.EFI, not UEFI BootOrder, so it presented the stale loader instead of Windows. The complete recovery was:

  1. Replace the stale Windows-ESP fallback loader with its own EFI/Microsoft/Boot/bootmgfw.efi.
  2. Enable Limine's fallback loader on Omarchy's ESP, remove only confirmed-stale EFI directories/NVRAM entries, and put Limine then Windows first in BootOrder.
  3. Run sudo limine-scan and select only Windows Boot Manager, adding it to Limine's menu.

The key fix for omarchy-refresh-limine is different: it should preserve existing non-Omarchy boot blocks when rewriting limine.conf. Re-running limine-scan is useful manual recovery, but it is interactive and depends on the Windows Boot Manager firmware entry being present.

When I recovered with sudo limine-scan, it wrote a cross-partition reference, not a copy of the binary onto Omarchy's ESP:

/Windows Boot Manager
comment: order-priority=20
protocol: efi
path: uuid(436e72a5-8451-4fe8-a740-db6900e5bb20):/EFI/Microsoft/Boot/bootmgfw.efi

Because it's a uuid(...) pointer at the real Windows ESP rather than a copied bootmgfw.efi, the entry continues to use the binary Windows Update maintains on that ESP.

Minimal recovery for anyone hitting this now (separate ESPs, Windows already installed):

sudo limine-scan        # pick "Windows Boot Manager" from the list

That alone re-adds it. omarchy-refresh-limine also leaves a /boot/limine.conf.bak, so sudo cp -a /boot/limine.conf.bak /boot/limine.conf restores the pre-refresh state if you'd rather not rescan. This restore does not require a Windows Boot Manager NVRAM entry, although the referenced Windows ESP and boot file must still exist.

Ser-Zile avatar Aug 24 '26 15:08 Ser-Zile

So , i have CachyOS on main SSD , have a load of Linux Dists on 1000GB HDD so decide to install Omarchy on HDD partition and the fooker just takes over every boot option , Windows gone from HDD part , Cachy gone but the boot tags still in boot options but everyone goes to Omarchy...hahaha..i have solved this if anyone wants to hear my pain.

one-media-asia avatar Aug 30 '26 03:08 one-media-asia

Windows UEFI partition is too small for Linux UEFI

wafcio avatar Sep 04 '26 00:09 wafcio

The second bug is confirmed. On a disposable VM installed from the Omarchy 4.0.4 ISO (limine 12.8.0, limine-mkinitcpio-hook 1.38.0), I added a /Windows Boot Manager entry in the format limine-scan writes and ran omarchy-refresh-limine from quattro at b83d3df08. Afterwards /boot/limine.conf held only /+Omarchy and /EFI fallback, and the Windows entry survived only in /boot/limine.conf.bak.

The cause is bin/omarchy-refresh-limine lines 14–16: it moves the live file aside and copies in default/limine/limine.conf, which has no entries at all. limine-update then rebuilds only this installation's entry, and limine-snapper-sync only its snapshots, so anything limine-scan added (the step manual/50-dual-boot-install.md tells dual-boot users to take) is gone. Besides direct use, it runs from omarchy-reinstall-configs, and so from omarchy reinstall.

The first bug isn't in this repository: the free-space install's partitioning belongs to the ISO installer. A separate ESP may well be deliberate, since a stock Windows ESP is 100 MB and Omarchy keeps its UKIs and snapshot copies on the ESP. The firmware not listing the new boot entry looks like the same symptom as #10598.

I haven't opened a fix. Deciding which entries a refresh keeps, and in what order, decides what the machine boots: the template's default_entry: 2 assumes the Omarchy entry comes first. #13699 is settling that same question for factory reset, and a fix here should follow whatever it lands on. This now waits on the maintainer.

This diagnosis was checked by one model only, Claude Opus 5.5. The second opinion, Codex Medium, was up and answering but had used up its daily review allowance, so nothing independent checked this.

omarchybot avatar Oct 08 '26 13:10 omarchybot

One requirement for whichever fix lands for the second bug: please keep every entry that isn't this installation's, whatever its protocol, not only the protocol: efi entries limine-scan writes today.

For dual-boot users who keep BitLocker on, a Windows entry that hands over to the firmware avoids recovery-key prompts after Limine updates:

/Windows
    protocol: efi_boot_entry
    entry: Windows Boot Manager

With Secure Boot off, a chainloading entry puts Limine in Windows' TPM measurements (PCR 4), so each Limine update makes BitLocker ask for the recovery key; efi_boot_entry sets BootNext and resets, so Limine isn't measured. More on that entry, and options for adding it, in #16927. A fix here that recognises only today's limine-scan format would still drop these entries.

diogovalada avatar Oct 28 '26 16:10 diogovalada

The fix for the second bug is up as #17300. My last comment said a fix here should follow whatever factory reset settled on. That landed in #14949, and #17300 applies the same rule to omarchy-refresh-limine. It keeps every top-level entry that isn't this installation's, whatever its protocol. It keeps only the header of this installation's entry, so limine-update refills it in place ahead of the others, where default_entry: 2 points. @diogovalada, that covers the efi_boot_entry Windows entry you described: nothing here looks at the protocol.

On a disposable VM installed from the Omarchy ISO (limine 12.9.6, limine-mkinitcpio-hook 1.40.0), I added a Windows entry in the format limine-scan writes, an efi_boot_entry Windows entry, a second Linux install with its own kernel entry, and an indented entry after it. Then I ran the refresh twice. The script on quattro (e2c7007c1) dropped all four. #17300 kept all four and kept Omarchy first with its kernel and snapshot entries rebuilt. It duplicated nothing across the two runs, and every boot():/ hash still matched its file. With no limine.conf at all, it writes the template and rebuilds, as before. ./test/cli passes.

Codex Medium and muse-wonder (via pi, thinking high) reviewed the fix as second opinions. Both found that a failure reading the old config would still have written the template-only file and lost the entries. Codex also found that indented entries, which Limine accepts, were missed. Both are fixed in #17300, and a second round from both found nothing open. Their independence from this session isn't guaranteed.

The first bug, the separate ESP, is unchanged: it belongs to the ISO installer, not this repository. #17300 now waits on the maintainer's review.

omarchybot avatar Nov 01 '26 22:11 omarchybot