0

I have 2 nvme drives one with Windows 10 and the other Arch Linux installed. I was under the impression that the 2 OSes have their bootloaders on their own disks which is not the case in retrospect.

Today I took a look at the efi partition of the linux disk and found a windows entry. I thought this was redundant and wanted to remove it. In the spirit of backing up things, I made a copy of /boot/EFI/Microsoft directory.

Now after reboot, the windows boot entry disappeared from the motherbother's boot menu. So I went back into Arch and put the backup directory back. But the windows boot entry didn't reappear after another reboot. I tried disabling fast boot but it didn't help.

Anything I can do to fix this issue preferably from Linux? Also downloading windows disk image in case that is required.

Here's the disk setup and content of the esp.

❯❯❯ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 960 EVO 500GB               
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 01DE889D-9319-4179-920D-4EB5E1A08F94

Device         Start       End   Sectors   Size Type
/dev/nvme0n1p1  2048     34815     32768    16M Microsoft reserved
/dev/nvme0n1p2 34816 976773119 976738304 465.8G Microsoft basic data

❯❯❯ sudo fdisk -l /dev/nvme1n1
Disk /dev/nvme1n1: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 970 EVO 500GB               
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 270C4D3C-BF3C-4DF1-A834-C03B8BBB6692

Device             Start       End   Sectors   Size Type
/dev/nvme1n1p1      2048   1050623   1048576   512M EFI System
/dev/nvme1n1p2   1050624  34605055  33554432    16G Linux swap
/dev/nvme1n1p3  34605056 708337678 673732623 321.3G Linux filesystem
/dev/nvme1n1p4 708339712 976773134 268433423   128G Linux filesystem

❯❯❯ tree -L 4 /boot
/boot
├── e0dbb6ba929948f599abce57c8e2eb65
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Microsoft
│   │   ├── Boot
│   │   │   ├── BCD
│   │   │   ├── BCD.LOG
│   │   │   ├── BCD.LOG1
│   │   │   ├── BCD.LOG2
│   │   │   ├── bg-BG
│   │   │   ├── bootmgfw.efi
│   │   │   ├── bootmgr.efi
│   │   │   ├── BOOTSTAT.DAT
│   │   │   ├── boot.stl
│   │   │   ├── cs-CZ
│   │   │   ├── da-DK
│   │   │   ├── de-DE
│   │   │   ├── el-GR
│   │   │   ├── en-GB
│   │   │   ├── en-US
│   │   │   ├── es-ES
│   │   │   ├── es-MX
│   │   │   ├── et-EE
│   │   │   ├── fi-FI
│   │   │   ├── Fonts
│   │   │   ├── fr-CA
│   │   │   ├── fr-FR
│   │   │   ├── hr-HR
│   │   │   ├── hu-HU
│   │   │   ├── it-IT
│   │   │   ├── ja-JP
│   │   │   ├── kd_02_10df.dll
│   │   │   ├── kd_02_10ec.dll
│   │   │   ├── kd_02_1137.dll
│   │   │   ├── kd_02_14e4.dll
│   │   │   ├── kd_02_15b3.dll
│   │   │   ├── kd_02_1969.dll
│   │   │   ├── kd_02_19a2.dll
│   │   │   ├── kd_02_1af4.dll
│   │   │   ├── kd_02_8086.dll
│   │   │   ├── kd_07_1415.dll
│   │   │   ├── kd_0C_8086.dll
│   │   │   ├── kdstub.dll
│   │   │   ├── ko-KR
│   │   │   ├── lt-LT
│   │   │   ├── lv-LV
│   │   │   ├── memtest.efi
│   │   │   ├── nb-NO
│   │   │   ├── nl-NL
│   │   │   ├── pl-PL
│   │   │   ├── pt-BR
│   │   │   ├── pt-PT
│   │   │   ├── qps-ploc
│   │   │   ├── Resources
│   │   │   ├── ro-RO
│   │   │   ├── ru-RU
│   │   │   ├── sk-SK
│   │   │   ├── sl-SI
│   │   │   ├── sr-Latn-RS
│   │   │   ├── sv-SE
│   │   │   ├── tr-TR
│   │   │   ├── uk-UA
│   │   │   ├── winsipolicy.p7b
│   │   │   ├── zh-CN
│   │   │   └── zh-TW
│   │   └── Recovery
│   │       ├── BCD
│   │       ├── BCD.LOG
│   │       ├── BCD.LOG1
│   │       └── BCD.LOG2
│   └── systemd
│       └── systemd-bootx64.efi
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── intel-ucode.img
├── loader
│   ├── entries
│   │   └── arch.conf
│   ├── loader.conf
│   └── random-seed
├── System Volume Information
│   ├── AadRecoveryPasswordDelete
│   └── ClientRecoveryPasswordRotation
└── vmlinuz-linux
  • You must have had Linux drive as default in UEFI boot, or selected to install Windows to a different drive than default. Best to have ESP on each drive, but many systems install only into one ESP. Do you have UEFI boot entry? With Ubuntu it is: sudo efibootmgr -v, not sure Arch is same or not. – oldfred Mar 6 at 14:53
  • @oldfred Yea I think that is what happened. Ended up creating a separate esp on the windows drive through a windows disk image. – n.z. Mar 7 at 0:30
0

I am not 100% certain on this but it seems that putting back the backup of windows boot entry did work. It did not show up initially though, probably because the motherboard boot loader did not reload/rescan the available boot entries. Not sure what caused it to reload/rescan but a few restarts later the entry showed up.

Also managed to create a new boot partition on the windows disk specifically to boot windows through a windows 10 disk image.

> diskpart 
DISKPART> sel disk WINDOWS_DISK
DISKPART> sel part WINDOWS_MAIN_PARTITION
DISKPART> shrink desired=512 
DISKPART> create partition efi size=512
DISKPART> format quick fs=fat32
DISKPART> assign letter=s
DISKPART> exit

> bcdboot X:\windows /s S:
where X is the windows volume letter

More details here https://www.tenforums.com/installation-upgrade/52837-moving-recreating-efi-partition-post698505.html#post698505

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.