UEFI Boot Manager Sequence Problems HP Envy

Home » CentOS » UEFI Boot Manager Sequence Problems HP Envy
CentOS 7 Comments

Morning all,

I have a HP Envy dual boot system (Win8 for serious stuff, i.e. Train Sim and Flight Sim) and CentOS 7 for everything else.

In the past I’ve had the occasional problem where an update on the windows side has updated the UEFI boot sequence but using efibootmgr has always fixed it.

On Friday I discovered that my HDD was failing so I tried using Clonezilla to move it on to a new SSD of the same size. Unfortunately the clone didn’t work, failing half way through my main partition. Thankfully the Windows partitions and boot info cloned across so that side of the system worked.

I then wiped all the Linux partitions and did a clean C7 install using the latest ISO, all went well, but when it reboot it went straight into Windows. Using F9 on reboot I chose CentOS Linux and the new system booted. Using efibootmgr I reset the boot sequence and all looked fine (see below).

Unfortunately, when I then reboot it reverts to booting Windows. Using F9 to get back into Linux then shows that the boot sequence has reverted. This means that the updated sequence either was not stored properly, or something is resetting it.

Legacy support in the BIOS is turned off as it should be, and the boot sequence in the BIOS only has a limited number of options. The sequence in the BIOS is:

UEFI Boot Order
USB Diskette on Key/USB Hard Drive
OS boot Manager (shown in white)
Internal CD/DVD ROM Drive
USB CD/DVD ROM Drive
! Network Adapter

Legacy Boot Order
Notebook Hard Drive
Internal CD/DVD ROM Drive
USB Diskette on Key/USB Hard Drive
USB CD/DVD ROM Drive
! Network Adapter

If I press I get the same options as in efibootmgr but the first option “Windows Boot Manager” is selected.

[root@gary ~]# efibootmgr BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0002,3002,0000,0003,0004,0005,2001,2002,2003
Boot0000* Linux
Boot0002* Windows Boot Manager
Boot0003* Fedora Boot0004* CentOS Linux Boot0005* CentOS
Boot2001* USB Drive (UEFI)
Boot2002* Internal CD/DVD ROM Drive (UEFI)
Boot3000* Internal Hard Disk or Solid State Disk Boot3002* Internal Hard Disk or Solid State Disk Boot3004* Internal Hard Disk or Solid State Disk
[root@gary ~]# efibootmgr -o 0004,2001,2002,3000
BootCurrent: 0004
Timeout: 0 seconds BootOrder: 0004,2001,2002,3000
Boot0000* Linux Boot0002* Windows Boot Manager Boot0003* Fedora Boot0004* CentOS Linux Boot0005* CentOS
Boot2001* USB Drive (UEFI)
Boot2002* Internal CD/DVD ROM Drive (UEFI)
Boot3000* Internal Hard Disk or Solid State Disk Boot3002* Internal Hard Disk or Solid State Disk Boot3004* Internal Hard Disk or Solid State Disk
[root@gary ~]# efibootmgr BootCurrent: 0004
Timeout: 0 seconds BootOrder: 0004,2001,2002,3000
Boot0000* Linux Boot0002* Windows Boot Manager Boot0003* Fedora Boot0004* CentOS Linux Boot0005* CentOS
Boot2001* USB Drive (UEFI)
Boot2002* Internal CD/DVD ROM Drive (UEFI)
Boot3000* Internal Hard Disk or Solid State Disk Boot3002* Internal Hard Disk or Solid State Disk Boot3004* Internal Hard Disk or Solid State Disk
[root@gary ~]#

7 thoughts on - UEFI Boot Manager Sequence Problems HP Envy

  • Hello,

    change the bootorder your first boot is windows

    Am Dienstag, 28. Mai 2019, 13:29:39 CEST schrieb Gary Stainburn:

  • I know, that’s my problem. If you look further down the OP I successfully change the boot sequence, but it doesn’t stay that way

  • I suggest running ‘blkid’ and ‘efibootmgr -v’, and double-check that the UUID for the CentOS boot entry matches the UUID of the EFI disk.

    You can delete and recreate the boot entry with ‘efibootmgr’, which will likely solve the problem.

    It depends on the UEFI implementation, but when all the boot entries are wrong (UUID changed due to new disk) sometimes it has a fallback to find the Windows bootloader and choose it.

  • Thanks Jonathan.

    You’re probably right about this as whever I try to do makes has effect.

    I’ve been looking in to efibootmgr to see what I need to do to get it working but so far with no luck.

    When I run it with -v I don’t see any UUID details, nor can i see how I specify them. One thing I have noticed is that in the blkid output below everything refers to HD(2,…… Is that correct?

    Below is one of many attempts to set the values correctly.

    [root@gary ~]# efibootmgr -v BootCurrent: 0004
    Timeout: 0 seconds BootOrder: 0002,3002,0000,0003,0004,0005,2001,2002,2003
    Boot0000* Linux HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shim.efi)
    Boot0002* Windows Boot Manager HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/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.}……………….. Boot0003* Fedora HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\fedora\shim.efi)
    Boot0004* CentOS Linux HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shim.efi)
    Boot0005* CentOS HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shimx64.efi)
    Boot2001* USB Drive (UEFI) RC
    Boot2002* Internal CD/DVD ROM Drive (UEFI) RC
    Boot3000* Internal Hard Disk or Solid State Disk RC
    Boot3002* Internal Hard Disk or Solid State Disk RC
    [root@gary ~]# efibootmgr -o 4,2001,2002,2
    BootCurrent: 0004
    Timeout: 0 seconds BootOrder: 0004,2001,2002,0002
    Boot0000* Linux Boot0002* Windows Boot Manager Boot0003* Fedora Boot0004* CentOS Linux Boot0005* CentOS
    Boot2001* USB Drive (UEFI)
    Boot2002* Internal CD/DVD ROM Drive (UEFI)
    Boot3000* Internal Hard Disk or Solid State Disk Boot3002* Internal Hard Disk or Solid State Disk
    [root@gary ~]# efibootmgr -v BootCurrent: 0004
    Timeout: 0 seconds BootOrder: 0004,2001,2002,0002
    Boot0000* Linux HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shim.efi)
    Boot0002* Windows Boot Manager HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/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.}……………….. Boot0003* Fedora HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\fedora\shim.efi)
    Boot0004* CentOS Linux HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shim.efi)
    Boot0005* CentOS HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shimx64.efi)
    Boot2001* USB Drive (UEFI) RC
    Boot2002* Internal CD/DVD ROM Drive (UEFI) RC
    Boot3000* Internal Hard Disk or Solid State Disk RC
    Boot3002* Internal Hard Disk or Solid State Disk RC
    [root@gary ~]# blkid
    /dev/mapper/CentOS-root: UUID=”08c18076-37b4-4f65-b550-e2633ac24d5d” TYPE=”xfs”
    /dev/sda6: UUID=”ifEKlz-O4SM-NevI-X4TQ-lQg2-0lAN-Jb7cZQ” TYPE=”LVM2_member” PARTUUID=”97e93e7c-a6cf-4532-8f7d-5c0e50987350″
    /dev/sda1: LABEL=”WINRE” UUID=”8262E42362E41DA3″ TYPE=”ntfs” PARTLABEL=”Basic data partition” PARTUUID=”277e20d2-ee46-412b-babb-9b2249324ca4″
    /dev/sda2: SEC_TYPE=”msdos” UUID=”1437-B8F4″ TYPE=”vfat” PARTLABEL=”EFI System Partition” PARTUUID=”14c4ac1d-abd8-4121-84ee-c05a825920de”
    /dev/sda3: LABEL=”Windows” UUID=”1098EFF798EFD96C” TYPE=”ntfs” PARTLABEL=”Basic data partition” PARTUUID=”f7cefd8f-73e7-4956-bb96-0c03ea21bff9″
    /dev/sda4: UUID=”12DC737EDC735B45″ TYPE=”ntfs” PARTUUID=”95f8994c-a8ad-48f5-9fbb-eda67c56f6e3″
    /dev/sda5: UUID=”de45b7f8-d072-4f7e-b9be-a62428db3fbb” TYPE=”xfs” PARTUUID=”8c00cc67-1063-4889-bdce-6f6259ba1491″
    /dev/sda8: LABEL=”RECOVERY” UUID=”74CCE22FCCE1EAF6″ TYPE=”ntfs” PARTLABEL=”Basic data partition” PARTUUID=”7c95ff6d-d945-4479-9100-f66aa81a403e”
    /dev/mapper/CentOS-swap: UUID=”30ca7d38-a0df-4473-a1d0-dc7a1fd41458″ TYPE=”swap”
    /dev/mapper/CentOS-home: UUID=”abcedda1-b69b-441e-bced-23a66b2b85f6″ TYPE=”xfs”
    [root@gary ~]# df Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/CentOS-root 52403200 7424692 44978508 15% /
    devtmpfs 6016292 0 6016292 0% /dev tmpfs 6034084 0 6034084 0% /dev/shm tmpfs 6034084 9820 6024264 1% /run tmpfs 6034084 0 6034084 0% /sys/fs/cgroup
    /dev/sda5 1038336 229176 809160 23% /boot
    /dev/sda2 204576 85252 119324 42% /boot/efi
    /dev/mapper/CentOS-home 688017172 428947768 259069404 63% /home tmpfs 1206820 8 1206812 1% /run/user/42
    tmpfs 1206820 0 1206820 0% /run/user/0
    [root@gary ~]#

  • This is all I was asking you to check. See the PARTUUID in the output of blkid? PARTUUID=”14c4ac1d-abd8-4121-84ee-c05a825920de”
    It matches the UUID of the boot entry:
    HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x6400\0)/File(\EFI\CentOS\shim.efi)

    I do see you have 4 separate boot entries for Linux (one oddly called fedora despite using the CentOS shim), you might do well to narrow them down to just one.
    (efibootmgr -B -b )

    If your BIOS has the ability to choose to boot from a file, I suggest giving that a try, and try both /EFI/CentOS/shim.efi and
    /EFI/CentOS/grubx64.efi. Perhaps one or the other isn’t working anymore.

  • I had already started this process, as I read on a post that deleting an option (or adding one) could possibly fix a corrupt database. I have now deleted all unrequired options.

    I tried the option to boot from an EFI file. All I got was:

    NO VOLUME LABEL,
    [Acpi(PNP0A03,0)/Pci(1F12)/Sata(0,0,0)/HD(Part2,Sig14CAC1D-ABD8-4121-84EE-C05A8259
    20DE)]

    I had the option to press enter to select an entry, which I did, and navigated to /EFI/CentOS/shim.efi.

    Doing this saw CentOS boot successfully. Presumably this means that the selected file is valid, but not being used.

    This is the current output from efibootmgr, but still does not give me what I want, and resets on restart. The options I deleted have stayed deleted though.

    Boot3000* Internal Hard Disk or Solid State Disk
    [root@gary ~]# efibootmgr -v BootCurrent: 0004
    Timeout: 4 seconds
    BootOrder: 2001,2002,0004
    Boot0002* Windows Boot Manager HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/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.}………………..
    Boot0004* CentOS Linux HD(2,GPT,14c4ac1d-abd8-4121-84ee-c05a825920de,0x145800,0x64000)/File(\EFI\CentOS\shim.efi)
    Boot2001* USB Drive (UEFI) RC
    Boot2002* Internal CD/DVD ROM Drive (UEFI) RC
    Boot3000* Internal Hard Disk or Solid State Disk RC
    [root@gary ~]#

  • I have been doing some more research on this and it appears that this is often a problem with the BIOS / EFI implementation not correctly respecting the boot order setting.

    However, as it used to work on this laptop with the previous HDD I do not believe this to be the point.

    Oddly, when I put the old HDD back in – to copy off some files I’d missed – it too had the problem with the boot order.

    One good thing I did get was a work-around suggested by someone. I have now

    efibootmgr -n 4

    in /etc/rc.d/rc./local (and enabled the rc-local service. This sets the next boot option to 4 every time I boot up. It doesn’t fix the original problem, but it does provide a working solution.

    I have also created /usr/local/bin/bootwin which contains

    efibootmgr -n 2
    reboot

    I just need to work out now how to do the same when in Win8 to allow me to boot back in to Linux without having to press F9 in the boot sequence.

    I would like to get to the bottom of the original problem just because it’s bugging me.