Dual boot configuration

First, apologies if this is the wrong section to post; there doesn’t seem to be one specifically for installation issues.

I’ve very recently installed Manjaro Gnome to dual boot on a brand new HP laptop (OmniBook 7 Aero 13 Ryzen) which had Windows 11 pre-installed. I dealt with bitlocker and the installation was successful. But the laptop always boots straight to Windows unless I go through an annoying series of keypresses at start-up: F9 > Boot options > Boot from EFI file > SYSTEM > EFI > Manjaro > grubx64.efi
The latter is naturally what I want to be offered immediately.

After some searching I found this:

Oh No - It boots directly to Windows - What do I do?
Just boot to Windows.

    Run CMD as Administrator
    bcdedit  /set  {bootmgr}  path  \EFI\Manjaro\grubx64.efi
    Reboot

[[root tip] [How To] Dual boot Manjaro and Windows]

It reported as a successful operation, but it made no difference. (And I had disabled Secure Boot.)

Further research gave me the confidence to try figuring out the problem from within Windows and I got the following:

C:\Windows\System32>bcdedit /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Manjaro\grubx64.efi
description             Windows Boot Manager
locale                  en-GB
inherit                 {globalsettings}
default                 {current}
resumeobject            {63a5f12b-9554-11f0-b545-a5f466109bac}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \windows\system32\winload.efi
description             Windows 11
locale                  en-GB
inherit                 {bootloadersettings}
recoverysequence        {5a40c61f-9562-11f0-a02e-820fa99dcf8d}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \windows
resumeobject            {63a5f12b-9554-11f0-b545-a5f466109bac}
nx                      OptIn

It appears I did successfully change the path to the Windows Boot Manager, but it’s the Windows Boot Loader that should be changed. But this is where I’m out of my depth and conscious that a false move could make matters a lot worse.

Should I simply run: bcdedit /set {current} path \EFI\Manjaro\grubx64.efi ?

I suspect it’s not as simple as that and would appreciate some expert advice.

I’m not so confident about this. Did you consider to use the rEFInd boot manager?

Thanks. No, I didn’t: first time I’ve come across it. It looks complex - more than I suspect I need to resolve my issue. I’d be very surprised if I need to install anything else - I just need guidance on tweaking what I’ve got.

To put it more bluntly, my guidance was “this is the wrong approach”. Boot managers are for managing boot loaders, so this is the right tool, cf. Installation alongside an existing UEFI Windows installation

I would not bother with the winboze loader. Just use grub. On major bios win updates or bios update or major grub updates you might need to repeat.

1 Like

@Teo
Thanks Teo, but with respect, my grub is not broken and doesn’t need restoring - I’m not failing to boot or getting a black screen. I can get to grub and load Manjaro successfully; it’s just a pain having to go through half a dozen key presses to do it. I’m pretty sure I simply need to configure the system to find it directly.

@jofi
Thanks jofi, but I’m not convinced. It looks like using a sledgehammer to crack a nut. And although rEFInd is platform independent, your link is to the Arch wiki, and I’ve read so many times Manjaro experts pointing out that Manjaro is not Arch. (And if rEFIfind was a necessary ingredient for a successful dual boot installation on modern systems I’d have thought it would be mentioned and recommended much more widely in the Manjaro documentation.)

Mod edit: Merged consecutive posts. Please use the Edit function to add more details. :wink:

The Arch wiki is the best reference out there. It shouldn’t be too hard to install rEFInd, see linux multi boot with refind (somewhat old). But then it’s only a consideration. I think setting the Windows Boot Manager path to Grub is just a hack. Perhaps this worked when it was posted back in 2020 or so but still even back then it was nothing more than a hack. :person_shrugging:

Could you please post the output of efibootmgr?

2 Likes

Is there no option in the BIOS that lets you set the boot order? Is there no option there to set Manjaro as the first boot option?

Are Manjaro and Windows on the same hard drive?

4 Likes

If you do not see the manjaro boot entry in the bios, then the efi variable for it was deleted. The install-grub rewrites the efi file AND sets the variable in the nvram.

Alternatively, the same can be achieved with the efibootmanager, a new entry has to be added pointing to the manjaro (grub) efi file.

Something like

sudo efibootmgr -c -L "manjaro" -l '\EFI\manjaro\grubx64.efi'
3 Likes
    ~  efibootmgr                                                       ✔ 
Timeout: 0 seconds
BootOrder: 0000,2001,2005,2002,2004
Boot0000* Windows Boot Manager	HD(1,GPT,f80c1f52-8f06-4991-989e-f4108339d98a,0x800,0x82000)/\EFI\Microsoft\Boot\bootmgfw.efiRC
Boot0002* Windows Boot Manager	HD(1,GPT,f80c1f52-8f06-4991-989e-f4108339d98a,0x800,0x82000)/\EFI\Manjaro\grubx64.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0003* Manjaro	HD(1,GPT,f80c1f52-8f06-4991-989e-f4108339d98a,0x800,0x82000)/\EFI\Manjaro\grubx64.efi
Boot2001* EFI USB Device	RC
Boot2005* Internal Hard Disk or Solid State Disk	RC
    ~            

@pwx
Thanks pwx. There are options in the BIOS to set the boot order, but only between USB, HDD, Network etc. Yes, Manjaro and Windows are on same drive - there’s only the one drive. During my research on this I read somewhere that HP laptops can be a pain when it comes to this as the BIOS flexibility can be limited.

Mod edit: Merged consecutive posts. Please use the Edit function to add more details. :wink:

rEFInd is nice, but I have GRUB installed, so this is my way:

These are the necessary packages:

> extra/grub-btrfs 4.14-1 (36.1 KiB 105.8 KiB) (Installed)
>     Include btrfs snapshots in GRUB boot options
> core/update-grub 2:2.14-1 (3.4 KiB 561.0 B) (Installed)
>     GNU Grub (2) Update Menu Script
> core/install-grub 2:2.14-1 (5.9 KiB 7.4 KiB) (Installed)
>     GNU Grub (2) Install Script on Updates
> core/grub 2:2.14-1 (12.2 MiB 41.5 MiB) (Installed)
>     GNU GRand Unified Bootloader (2)
> core/efibootmgr 18-3 (30.1 KiB 83.7 KiB) (Installiert)
>     Linux user-space application to modify the EFI Boot Manager
> core/efivar 39-1 (144.7 KiB 541.6 KiB) (Installiert)
>     Tools and libraries to work with EFI variables

Check that these are installed.

/etc/default/grub:
GRUB_DISABLE_OS_PROBER=false

sudo update-grub
The output should mention windows

sudo grub-install --target=x86_64-efi /dev/XXX

After the reboot you start with GRUB; there you should find Manjaro and Windows.

Thanks again pwx. All good as far as the last step: grub-install… Is it literally /dev/xxx I need to enter, or do I need to substitute a path relevant to my system for xxx, in which case how do I determine the correct path? (Sorry if this is a dumb question, but as you probably gather I’m out of my depth here.)

As we all know, there are no stupid questions, and if you don’t ask, you won’t learn anything.

Check the output for the hard drive with your dual installation:
sudo fdisk -x

That will replace the XXX.

If that is indeed true that the laptop is that old and has so limited and stripped uefi, there is still a way.

Go back to the Grub Reinstall wiki and use the --removable flag instead of the name manjaro Something like

grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable

That will update the fallback efi entry. After that choose the hard disk in the uefi settings.

Add the windows entry after you reboot to manjaro normally, it will not work in the chroot (as per instructions above, OS-prober enable, and update-grub.)

By the way the windows boot is somewhat messed up too, you might want to fix this first.

Or lsblk, no need for sudo: :wink:

Example from mine (single-boot though)
lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0    32M  0 part
├─sda2   8:2    0   384M  0 part /boot/efi
├─sda3   8:3    0   768M  0 part /boot
├─sda4   8:4    0    50G  0 part /
├─sda5   8:5    0    50G  0 part /home
├─sda6   8:6    0 806.4G  0 part /DATA
└─sda7   8:7    0    24G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom
1 Like

Is it not just the boot order?

BootOrder: 0000,2001,2005,2002,2004

So something like..

sudo efibootmgr --bootorder 0003,0000
5 Likes

That is the best idea so far. Very easy to test.

2 Likes

Done that pwx, but it still boots straight to Windows. However, definite improvement: when I hold F9 while booting it now gives me a straight choice between Windows boot manager and Manjaro,

The output from sudo fdisk -x is:

    ~  sudo fdisk -x                                                    ✔ 
[sudo] password for nick: 
Disk /dev/nvme0n1: 953,87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: PSENN001TA87QC0                         
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: 48C13179-0831-4DAC-9BAE-2C25ABADCECE
First usable LBA: 34
Last usable LBA: 2000409230
Alternative LBA: 2000409263
Partition entries starting LBA: 2
Allocated partition entries: 128
Partition entries ending LBA: 33

Device              Start        End    Sectors Type-UUID                            UUID                                 Name                         Attrs
/dev/nvme0n1p1       2048     534527     532480 C12A7328-F81F-11D2-BA4B-00A0C93EC93B F80C1F52-8F06-4991-989E-F4108339D98A EFI system partition         
/dev/nvme0n1p2     534528     567295      32768 E3C9E316-0B5C-4DB8-817D-F92DF00215AE EBAC6425-ABE2-41CD-B83C-E5D2719549A8 Microsoft reserved partition 
/dev/nvme0n1p3     567296 1026013183 1025445888 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 45EF9F14-4277-4555-B15E-4EBB621C6D61 Basic data partition         
/dev/nvme0n1p4 1998813184 2000396287    1583104 DE94BBA4-06D1-4D40-A16A-BFD50179D6AC 95CFA53F-AE96-4CC9-A5D0-7AB3378D8351 Basic data partition         RequiredPartition GUID:63
/dev/nvme0n1p5 1026013184 1998813183  972800000 0FC63DAF-8483-4772-8E79-3D69D8477DE4 D76CADE7-C303-4C12-9C1A-88CF7AE33509 root                         

Partition table entries are not in disk order.

So I tried: sudo grub-install --target=x86_64-efi /dev/nvme0n1 and that got the improvement mentioned above. Perhaps I should specify one of the partitions rather than the hard disk as a whole? One more tweak and I’ll have success?

Mod edit: Added backticks before and after command output. :slightly_smiling_face:

Legacy (BIOS) installations install GRUB directly to the drive’s boot sector; whereas (U)EFI installations use the EFI partition (/dev/nvme0n1p1 in your case). :wink:

Molski, thanks - I think you could be right. But sorry, I don’t do “something like” when I’m already out of my depth. Can you please confirm that this is a valid command to use and won’t make things worse?