1

I have migrated some old linux systems from an MBR based laptop with a dead GPU to a new machine and thought it would be best to keep things as simple as possible. So I disabled the CSM and specified UEFI in a number of places on the UEFI firmware setup screens. Naturally I followed the tutorials found elsewhere and set up the disks with ESP partitions where relevant. At this point I am able to boot into the various linux systems. But then I noticed that the Microsoft Windows 10 icon/entry had disappeared from the rEFInd welcome screen.

It looks like I did something I shouldn't have.

Apparently rEFInd is no longer able to find the Windows bootloader so I may have accidentally removed it?

Now the question is how would I go about figuring out what's broken in my setup (and possibly fix it)?

Not sure what kind of documentation might help diagnose.

Here's the output of the gdisk command on the two disks that matter:

GPT fdisk (gdisk) version 1.0.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: CT500MX500SSD1  
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): D63EB811-6D72-455C-9605-37C5D8507BF7
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 705976301 sectors (336.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   EF00  EFI system partition
   2        66635776       271437823   97.7 GiB    8300  
   5         1050624        66635775   31.3 GiB    8300  Linux filesystem

Command (? for help): q
___________________________________________________________________________________
 
root@pavo:~# gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdb: 500118192 sectors, 238.5 GiB
Model: KINGSTON OM8P0S3
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C70C063F-76CE-4D90-B234-A85625B4E965
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 187148909 sectors (89.2 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved ...
   3          468992       170446847   81.1 GiB    0700  Basic data partition
   4       498126848       500117503   972.0 MiB   2700  Basic data partition
   5       170446848       229040127   27.9 GiB    8300  
   6       229040128       229044223   2.0 MiB     EF02  
   7       229044224       310964223   39.1 GiB    8300  
   8       310964224       310980607   8.0 MiB     0700  

Command (? for help): q
root@pavo:~# ```

Update

As requested here's the output of the efibootmgr command:

root@pavo:~# efibootmgr -v
BootCurrent: 0004
Timeout: 65535 seconds
BootOrder: 0000,0002,0001,0004,0003
Boot0000* Windows Boot Manager  HD(1,GPT,bb717fa7-abdd-479c-bd4c-a017bf0f9f1a,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0001* debian        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0002* ubuntu        HD(1,GPT,bb717fa7-abdd-479c-bd4c-a017bf0f9f1a,0x800,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0003* deepin        HD(1,GPT,1b07c421-5264-41b7-b770-b929245d705c,0x800,0x64000)/File(\EFI\deepin\grubx64.efi)
Boot0004* UEFI OS       HD(1,GPT,bb717fa7-abdd-479c-bd4c-a017bf0f9f1a,0x800,0x32000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

Update - 2021/05/08:

Output of the requested commands:

root@pavo:~# tree /boot/efi
/boot/efi
└── EFI
    ├── BOOT
    │   ├── BOOT.CSV
    │   ├── bootx64.efi
    │   ├── drivers_x64
    │   │   └── ext4_x64.efi
    │   ├── icons
    │   │   ├── arrow_left.png
    │   │   ├── arrow_right.png
    │   │   ├── boot_linux.png
    │   │   ├── boot_win.png
    │   │   ├── func_about.png
    │   │   ├── func_bootorder.png
    │   │   ├── func_csr_rotate.png
    │   │   ├── func_exit.png
    │   │   ├── func_firmware.png
    │   │   ├── func_hidden.png
    │   │   ├── func_install.png
    │   │   ├── func_reset.png
    │   │   ├── func_shutdown.png
    │   │   ├── mouse.png
    │   │   ├── os_arch.png
    │   │   ├── os_artful.png
    │   │   ├── os_bionic.png
    │   │   ├── os_centos.png
    │   │   ├── os_chakra.png
    │   │   ├── os_chrome.png
    │   │   ├── os_clover.png
    │   │   ├── os_crunchbang.png
    │   │   ├── os_debian.png
    │   │   ├── os_devuan.png
    │   │   ├── os_elementary.png
    │   │   ├── os_fedora.png
    │   │   ├── os_freebsd.png
    │   │   ├── os_frugalware.png
    │   │   ├── os_gentoo.png
    │   │   ├── os_gummiboot.png
    │   │   ├── os_haiku.png
    │   │   ├── os_hwtest.png
    │   │   ├── os_kubuntu.png
    │   │   ├── os_legacy.png
    │   │   ├── os_linuxmint.png
    │   │   ├── os_linux.png
    │   │   ├── os_lubuntu.png
    │   │   ├── os_mac.png
    │   │   ├── os_mageia.png
    │   │   ├── os_mandriva.png
    │   │   ├── os_netbsd.png
    │   │   ├── os_network.png
    │   │   ├── os_opensuse.png
    │   │   ├── os_redhat.png
    │   │   ├── os_refind.png
    │   │   ├── os_refit.png
    │   │   ├── os_slackware.png
    │   │   ├── os_suse.png
    │   │   ├── os_systemd.png
    │   │   ├── os_trusty.png
    │   │   ├── os_ubuntu.png
    │   │   ├── os_unknown.png
    │   │   ├── os_void.png
    │   │   ├── os_win8.png
    │   │   ├── os_win.png
    │   │   ├── os_xenial.png
    │   │   ├── os_xubuntu.png
    │   │   ├── os_zesty.png
    │   │   ├── README
    │   │   ├── tool_apple_rescue.png
    │   │   ├── tool_fwupdate.png
    │   │   ├── tool_memtest.png
    │   │   ├── tool_mok_tool.png
    │   │   ├── tool_netboot.png
    │   │   ├── tool_part.png
    │   │   ├── tool_rescue.png
    │   │   ├── tool_shell.png
    │   │   ├── tool_windows_rescue.png
    │   │   ├── transparent.png
    │   │   ├── vol_external.png
    │   │   ├── vol_internal.png
    │   │   ├── vol_net.png
    │   │   └── vol_optical.png
    │   ├── keys
    │   │   ├── altlinux.cer
    │   │   ├── canonical-uefi-ca.cer
    │   │   ├── centos.cer
    │   │   ├── fedora-ca.cer
    │   │   ├── microsoft-kekca-public.cer
    │   │   ├── microsoft-pca-public.cer
    │   │   ├── microsoft-uefica-public.cer
    │   │   ├── openSUSE-UEFI-CA-Certificate-4096.cer
    │   │   ├── openSUSE-UEFI-CA-Certificate.cer
    │   │   ├── refind.cer
    │   │   ├── refind_local.cer
    │   │   ├── refind_local.crt
    │   │   └── SLES-UEFI-CA-Certificate.cer
    │   ├── refind.conf
    │   └── refind.conf-sample
    └── tools

6 directories, 91 files
root@pavo:~# lsblk -o PARTUUID
PARTUUID











1b07c421-5264-41b7-b770-b929245d705c
39a19869-4d29-444f-a156-b4c5777b34c0
5b4c8c9f-f12d-4bbd-ae8e-17043b2e4510
07b2faf3-f0ce-4d73-ab59-b87b5f8b66a6

bb717fa7-abdd-479c-bd4c-a017bf0f9f1a
9b6445b7-5cdb-4462-b9cf-5b0c5b2bb9ae
879b7145-b406-4467-81bd-f66739b8e072
c7013692-6d6f-427b-a6b0-03fb3294e571
452bb93f-6eaf-498a-a817-19cb26c00740
f3400b2d-753b-41ec-8aca-5774d73b2c1e
0a28e723-c34b-fa49-9f37-7158ddcaa8e0
ef8c9c3f-54b2-0f47-929e-6ee0bf5178a6
7
  • Does Windows directly boot from UEFI one time boot menu key? Often f12 but varies by mfg/model, same key you use to boot live installer. Lets see details, use ppa version with your live installer (2nd option) or any working install, not Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), do not run the auto fix till reviewed. help.ubuntu.com/community/Boot-Repair
    – oldfred
    Commented May 6, 2021 at 18:40
  • The "one time boot menu key" being the list of devices immediately after the machine starts where you get the list of devices that you can boot from? As a matter of fact I have just realized that I am no longer presented with this list: the first thing I see is the rEFInd screen. Is this what you are referring to? Commented May 6, 2021 at 18:52
  • Before rEFInd should be the UEFI boot menu, if you press the correct key. But if you have UEFI fast boot on (different that Windows fast start up), you may not have time to press any key. Then you should be able to do a full "cold" boot not a "warm" reboot to get time to press a key. May sure all power is off & drained from system before booting.
    – oldfred
    Commented May 6, 2021 at 18:55
  • There is a timer in the American Megatrends BIOS that was somehow reset to 1 sec. I changed that to "wait for ever (0xffff) and was able to access this menu after rebooting. The first entry has something like P1: Windows 10 boot manager. Tried that and it did nothing. Another entry points to the same disk and when I choose that I am back at the rEFInd screen. Not sure what you would like me to do at this point: I do not have a live installer since I migrated the linux systems from my old machine to the new. Do I need to create a ubuntu (or other) live installer and boot off of that? Commented May 6, 2021 at 19:27
  • Grub only boots working Windows, so if booting Windows directly from UEFI does not work, then grub will not boot it. If Windows does nothing, it must need major repairs. Usually you can start to boot Windows and f8 into its internal repair console to fix many things. You need to use your Windows repair/recovery flash drive and see if it can repair Windows.
    – oldfred
    Commented May 6, 2021 at 20:05

1 Answer 1

0

The partition /dev/sdb1 is probably the EFI System Partition for your Windows. It should be a FAT32 partition, so mount it somewhere, e.g. to /mnt and then see if /mnt/EFI/Microsoft/Boot/bootmgfw.efi exists. This would be the Windows Boot Manager, the first step in loading Windows on a UEFI system.

You should run efibootmgr -v as root and edit the output into your question. If the output does not include a line with "Windows Boot Manager", then the UEFI boot variable for Windows has been lost.

If that is the problem, and the bootmgfw.efi and other Windows bootloader files are in place in the EFI System Partition, you should be able to recreate the boot variable with:

efibootmgr -c -d /dev/sdb -l \\EFI\\MICROSOFT\\BOOT\\BOOTMGFW.EFI -L "Windows Boot Manager"

The first time you boot to Windows after this, Windows 10 will most likely add some binary parameters to the boot entry automatically to "self-heal".

4
  • It does contain a line that says: Windows Boot Manager. On the other hand I'm not sure about the linux stuff: for one thing the Deepin partition lives on a different disk. Commented May 6, 2021 at 20:20
  • The efibootmgr -v output indicates that the Windows Boot Manager and Ubuntu both use the same EFI System Partition (ESP). Also, the currently-booted OS is started from the same ESP using the "UEFI OS" line, indicating that at least the fallback/removable media bootloader slot has been taken over by the current OS; typically Windows would have a copy of its bootloader there. If /boot/efi exists as a mounted filesystem in the current OS, tree /boot/efi would be useful; also the output of either lsblk -o +PARTUUID or blkid would allow identifying the ESPs of each boot entry.
    – telcoM
    Commented May 7, 2021 at 6:39
  • Edited my question above with the output of the requested commands. Commented May 9, 2021 at 4:35
  • Looks like the /boot/efi/EFI directory normally contains a ../Microsoft/boot/ subtree containing the bootmgfw.efi bootoader & possibly other things as well and whatever I did this sub-directory is gone. Any idea how I could restore it? Commented May 9, 2021 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .