First off, sorry if this isn’t quite the right community, I did try posting on !pop_os@lemmy.world but didn’t get a solution. You can see that post here

I have my computer set up to dual boot pop!_os and windows on separate drives. I have my UEFI set up to boot into pop OS and I use systemd-boot to load windows, however after booting to windows and restarting my UEFI boot preferences are changed so Windows boots first instead of pop os.

I have fast boot and secure boot turned off in the bios and fast boot turned off in windows. How can I prevent this?

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    18
    ·
    edit-2
    1 year ago

    UEFI provides an API to alter the boot order from within the OS. It can also set a “use this boot entry only the next boot then revert to your standard configuration”. It’s possible that something caused Windows to update the boot configuration, for example during a major upgrade. Linux can do this too, for example when launching some firmware updates.

    Based on your pastebin, it seems that /EFI/BOOT/BOOTX64.EFI is the only registered bootloader. This is the Windows bootloader and also the fallback bootloaders.

    If you’ve installed systemd-boot into that location, you’ll end up with two operating systems fighting over the fallback bootloader entry, which isn’t what you want, I assume.

    I also don’t see your systemd-boot bootloader entry in the EFI variables. I think that if you can resolve that, your problems should be over.

    The Arch wiki lists a command you can use to manually register systemd-boot:

    sudo efibootmgr --create --disk /dev/sdX --part Y --loader "\EFI\systemd\systemd-bootx64.efi" --label "Pop_OS" --unicode
    

    You’ll need to find the partition number and the reference to the disk in /dev for your boot partition /dev/disk/by-partuuid/172a0183-3a89-4b78-b1b3-d016ca6675f7. You can try using ls -l /dev/disk/by-partuuid/172a0183-3a89-4b78-b1b3-d016ca6675f7 to see where it points (i.e. for /dev/sdb2 you would use --disk /dev/sdb --part 2).

    After creating the entry, you can go in and change the boot order. You should find “Pop_OS” in the boot order as a separate entry.

    Edit: I found this project which seems to provide a GUI for efibootmgr. Sadly, the prompt for adding a new bootloader is rather crude, asking you to type in all the details.

    • rickywithanm@aussie.zoneOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I’m a little confused about what I’m meant to be doing in this part

      You’ll need to find the partition number and the reference to the disk in /dev for your boot partition /dev/disk/by-partuuid/172a0183-3a89-4b78-b1b3-d016ca6675f7. You can try using ls -l /dev/disk/by-partuuid/172a0183-3a89-4b78-b1b3-d016ca6675f7 to see where it points (i.e. for /dev/sdb2 you would use --disk /dev/sdb --part 2).

      I also, get this error “invalid numeric value Y” when trying to manually register systemd-boot

      • Skull giver@popplesburger.hilciferous.nl
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        1 year ago

        The weird long /dev/disk/… I used comes straight from your Pastebin. It’s a unique link to the your EFI partition, but sadly efibootmgr can’t use that to register your bootloader. The Arch wiki example command leaves X and Y for you to fill in, and you need to find the X and Y for your system to make it work. They’re different for every computer so I can’t tell you what they are.

        On my system, the EFI partition is /dev/disk/by-partuuid/2fbab938-cc71-407a-996a-874d4486fca8. I used the ls command to find the right information in my example above, but realpath is probably better, so I’ll use that in this comment.

        I can find out the right X and Y for my system using the following command:

        user@ desktop ~ $ realpath /dev/disk/by-partuuid/2fbab938-cc71-407a-996a-874d4486fca8                       
        /dev/sde1
        

        As you can see, /dev/disk/by-partuuid/2fbab938-cc71-407a-996a-874d4486fca8 actually points to /dev/sde1. That means my disk (“X”) is sde and my partition number (Y) is 1.

        What this means in my case is that I would need to issue the following command to register systemd-boot:

        sudo efibootmgr --create --disk /dev/sde --part 1 --loader "\EFI\systemd\systemd-bootx64.efi" --label "Pop_OS" --unicode
        

        Notice how I filled in the e for X in /dev/sdX and 1 for Y.

        After running the registration command, I get the following output:

        BootCurrent: 0014
        Timeout: 1 seconds
        BootOrder: 0004,0003,0000,0015
        Boot0000* Windows Boot Manager
        Boot0001  Hard Drive
        Boot0002  USB KEY
        Boot0003* ubuntu
        Boot000E  Hard Drive
        Boot0010  USB KEY
        Boot0015  Hard Drive
        Boot0004* Pop_OS
        

        Ignore all the weird device names, my motherboard injects those into the configuration. The important part is that my computer’s boot order is 0004 (Pop_OS), 0003 (ubuntu), 0000 (Windows Boot Manager), and lastly 0015 (a random hard drive). This is the order of bootloaders my computer will try before throwing up a “no bootable device” error. The asterisks next to the name indicate that they’re enabled somewhere in the boot order.

        These numbers will look different on your computer. What you’ll probably want to do, is copy the bootorder as listed by the command that added the Pop_OS boot entry and add the number of your new bootloader in front.

        Suppose I want to change my system to try to boot Pop_OS first, then ubuntu, then Windows Boot Manager. I can do that without booting into my BIOS through the following command:

        sudo efibootmgr --bootorder 0004,0003,0000
        

        You can pick any order, but I would advice not removing any unless you know what you’re doing.

        • rickywithanm@aussie.zoneOP
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          I understand now. I now have a pop OS boot entry, and it’s set as first boot priority. However, I’m still having the original issue of windows putting itself first on the boot priority after rebooting from windows.

          Edit: after another reboot the pop_os boot entry I just made has vanished

          • If the boot entry vanishes, something funky is going on with your UEFI firmware.

            I’ve had this issue and the only way I could fix it was to factory reset the motherboard. I think something corrupted the UEFI variables and broke its ability to take new boot configuration.

            I don’t think either Windows or Linux can fix this for you, unfortunately.

      • Ludrol@szmer.info
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        lsblk -o NAME,SIZE,MOUNTPOINTS,UUID try this command, it will show you what partitions you have on the machine then modify previous command with correct labels and UUID

        sometimes you need to modify the command
        sudo efibootmgr --create --disk /dev/sdX --part Y --loader “\EFI\systemd\systemd-bootx64.efi” --label “Pop_OS” --unicode
        /dev/sdX --part Y needs to be replaced with correct labels for partitions, If you are lost just paste the output of the lsblk -o NAME,SIZE,MOUNTPOINTS,UUID command

  • alpaga1@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Hi I am not a linux pro, but for me a quick fix what worked was to disable Windows boot. basically everytime windows boot it puts itself as priority, but cannot any more this way. I would then use the grub menu at boot to select what os i needed. I use mint but since both are based on ubuntu should work in the same way. found this online, more or less what i did: https://unix.stackexchange.com/questions/241809/grub2-gone-every-time-i-boot-windows-10 https://unix.stackexchange.com/questions/68581/how-can-i-prevent-windows-from-overwriting-grub-when-using-a-dual-boot-machine

  • flashgnash@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    My solution to this was to just set the boot order how I wanted it and then lock it from BIOS

  • ebits21@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    My solution years ago when windows used to do this to me with a dual boot was to move windows to a virtual machine instead, which works great for me!

    Would recommend as much ram as possible though. I find performance great with 16gb of ram to share between host and the vm.

    Windows updates would often mess up boot prior to me switching. Very annoying.

    • danielton@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      What VM software would you recommend? The issue I always run into is GPU acceleration whenever I use the usual virt-manager or VirtualBox.

      • ebits21@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Virt-manager is my preferred but I only have integrated graphics anyway.

  • putoelquelolea@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I had a similar issue, and no changes made in Linux would stick. Bootice is a Windows program that allows you to make changes in UEFI boot order and was the only solution that worked for me. Good luck!