How can I securely install and use Windows & Ubuntu in dual boot. What I mean is how can I avoid GRUB failures, bootloader being overwritten by Windows? Is there a best practice (maybe backing up or something else)?
-
Welcome to Ask Ubuntu, please edit your question and add more details. your question is too vast. – Jan 18 '19 at 04:15
-
Most problems with dual-boot are caused by Windows. Do feel free to complain to Microsoft; you did pay good money for incompatible and data-destroying features like Fastboot, Dynamic Disks, and Windows upgrades that overwrite the bootloader. – user535733 Jan 18 '19 at 04:16
-
@user535733 how to overcome bootloader being overwritten? can I make a backup and fix it when it disapears? By the way, write your answer as an answer, not as a comment so that I can give you kuddos ;) – Tosh Jan 18 '19 at 16:08
-
Possible duplicate of How can I dual boot Windows and Ubuntu? – janot Jan 19 '19 at 00:58
-
Possible duplicate of How do I install Ubuntu alongside a pre-installed Windows with UEFI? – Charles Green Jan 20 '19 at 01:13
2 Answers
Firstly, make sure you install Windows BEFORE you install Ubuntu. The latest (at the time of writing) Windows 10 versions will probably break grub once you boot into Windows, but it can be prevented.
A solution I found somewhere online (unix.stackexchange.org) involves deactivating windows boot manager. Get into Linux (either the original install, if you can or live CD/DVD) and run this command:
efibootmgr
Note that this method will only work if Linux has been installed in UEFI mode, so you'll get an error if Linux has been installed in Legacy mode. If you installed it in UEFI mode, you'll get some info and a list. You'll notice Windows boot loader/manager and Linux somewhere in the list. It's likely that Windows will have higher priority (boot order is above the list).
There are also stars* beside some, if not all, of the entries, marking them active.
Look at the 4 digit boot number next to Windows entry and run
sudo efibootmgr --bootnum #### --inactive
This will deactivate Windows entry. Also, make sure that now deactivated Windows has higher priority if it doesn't already:
sudo efibootmgr --bootorder ####,$$$$,&&&&,%%%%
where #### is Windows boot number.
If you reboot now, you'll boot to grub, if the Linux option is enabled with the highest priority.
Note that Windows doesn't seem to recognize that it's been deactivated, so this will not get reverted by booting into Windows or updating it.
I participated in a local Linux installfest where we install Linux for interested people, most often as a secondary OS next to Windows. I've yet to see this method fail, and I've tried it on several distros (mostly Ubuntu and Mint) and several vendors (Asus, Acer, HP, Lenovo).

- 303
- 1
- 2
- 10
-
1Thank you for your full answer. I'll try it out and get back to you, but I don't know when. I can not up-vote yet, but when I get reputations I'll definitely vote for your answer :) – Tosh Mar 07 '20 at 12:47
For dual boot where you run one or the other, many are doing this with Windows and Ubuntu (I'm doing it with Win10 and Kubuntu 18.04). If you're not well experienced with Linux, you need to partition your drive into at least 2 sections and install Windows first, then Ubuntu. Ubuntu is smart and will see your Windows and then GRUB will create a menu where you can choose which OS to boot.

- 154
-
Yes I mean dual boot. How can I overcome bootloader being overwritten by windows? can I make a backup and fix it when it disapears? – Tosh Jan 18 '19 at 16:11
-
You can restore boot loader, there are few ways one of them boot from live cd, and reinstall grub – LeonidMew Jan 18 '19 at 16:27
-
As I said above, install Windows FIRST, then install Ubuntu which will NOT overwrite the boot files. Ubuntu will see your Windows installation and add a menu to allow you to boot either Windows or Ubuntu, just arrow down and hit
to load the OS you want to run. – Compatico Jan 19 '19 at 00:46