3

I have been dual booting for years now and have problem I can't seem to solve myself. As we all know Windows is an arrogant dick, and in my case whenever I chose to boot to it it will, automatically without asking me, alter my boot up settings in my BIOS and make itself de-facto king. Mildly annoying as all I had to do with enter setup, change the boot order and carry on.

Now however it is ALSO deleting the grub entry option in my BIOS, meaning I need to load a Live-USB and perform a boot repair (or what have you) to fix it. Long winded just to fix grub.

Now, several questions:

  1. How do I stop Windows 10 from doing this? (would fix all my problems)
  2. Else, since this never used to happen, is there a way of remaking the Grub boot option in my BIOS without a long winded string of commands to reinstall grub? (why is the grub option now not sticking around)
  3. Would I be better of not using EFI boot options if possible (all of my disks are less than 1TB) if that's possible.

Using an AsRock Z77 Extreme 4 motherboard. Have 3 SSD's laid out like this currently (in case my method is just wrong someone can correct me):

  1. Disk A is 240GB and used for Windows. I left 550MB free for another EFI partition and let Windows do it's thing with the rest of the drive.
  2. Disk B is 120GB and used for root, and it has a 'backup' partition on there (not required by either OS on boot).
  3. Disk C can be ignored essentially, 1 partition, mounted to /home and used only by Linux.

    NAME FSTYPE SIZE MOUNTPOINT LABEL sda 238.5G
    ├─sda1 16M
    ├─sda2 ntfs 237.9G
    └─sda3 vfat 525M /boot/efi
    sdb 119.2G
    ├─sdb1 ext4 62G /media/root/Furnace Furnace
    └─sdb2 ext4 39.4G /
    sdc 477G
    └─sdc1 ext4 477G /home

What do now?

Noki
  • 932
  • 1
    Regarding 1. we do not support Windows. my solution was to remove Windows ;-) You can do that too: make a backup of personal files. put Ubuntu on all of the disks. install virtualbox, windows in there, the software you need in windows and restore your files. – Rinzwind Apr 07 '19 at 14:36
  • 1
    Boot-Repair uses grub to reinstall grub. And grub uses the efibootmgr command to add & set ubuntu as first entry. Can you not use efibootmgr to change boot order? Some other alternatives: https://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 and just boot order: http://askubuntu.com/questions/485261/change-boot-order-using-efibootmgr – oldfred Apr 07 '19 at 15:15
  • I am able to use this to patch my boot issues. I am now back to my starting point as I cloned the Grub entry to stop it from being deleted (I always have a backup). Now I am down to the windows issue (not for this thread really but the linux community are more likely to have an answer to it than the Windows one). Thanks for you help. – Noki Apr 12 '19 at 11:54

1 Answers1

4

Using 'efibootmgr' I was able to clone my grub entry (a couple of times to be sure) in order to stop this from happening.

efibootmgr -v
Boot0000* Grub - Linux  HD(1,GPT,0a6d5fbb-b2bf-45f9-a81a-9a8de8693dcd,0x800,0x106800)/File(\EFI\ubuntu\shimx64.efi)

I was then able to copy it (make a new one with identical params) like so:

sudo efibootmgr --create --disk /dev/sda --part 1 --write-signature --loader /EFI/ubuntu/shimx64.efi --label "Linux - Grub" --verbose

This obviously doesn't solve the Windows being a dick part (but as mentioned in comments, this is not the place for that).

Thanks, Noki

Noki
  • 932
  • Could you explain a bit more? As in, does your second code remake/reinstate the grub? or just backs it up after cloning it? – Abdulla Masud Jan 14 '24 at 22:35
  • 1
    This is not Grub specifically. This is to modify the EFI (BIOS) directly. Then grub references this to boot into whatever OS. I never directly solved this problem, it just went away by itself. Maybe a Windows update. Not that I use Windows much at all anymore. – Noki Jan 15 '24 at 23:03