I know there are a lot of people who are concerned about the possibility that having a dual-boot setup with Windows and Linux could lead to trouble– specifically, Windows might do something and overwrite the bootloader, rendering the Linux installation unbootable.
I’ve been using dual-boot for a couple of years now, and while I know there are people out there who have way more time than that, they undoubtedly will have come to the same conclusion if they’ve been using it that long, and that’s that it works. There are all sorts of things that can happen to make your computer not work the way you would want, and if you avoid them all, you’ll never actually do anything with the computer. That’s why I am so insistent upon backups, and not just of your important personal data (though that is the most important). Full backup images can turn a glitch that completely borks Windows/Linux and forces a complete reinstall of everything (if you can even remember all the things you did!), which for me is many, many hours of work, into something trivial. If the easy steps like what I am about to describe don’t work, I will typically go right to restoring the backup, since I know that will work, and requires little effort on my part.
If you haven’t made a backup prior to the dual boot breakage, please do so before proceeding, even though the system is not working perfectly at the moment (the various backup programs like Macrium Reflect will write a rescue USB drive or DVD that can perform backups even when the system isn’t bootable). In the rare event that things are really badly messed up , you want to at least be able to get back to where you are now. That’s just good advice in general working with things like this… I’ve never had to resort to that, but you never know.
A messed-up dual boot, though, is not something that will usually require such a heavy-duty solution. Here’s what I’ve used with success to fix dual-boots when they have gotten messed up (though always through things like me resizing and adding partitions, which is an inherently risky thing to do. Windows itself never caused this issue, though I must add that I don’t use Win 10 either).
First, go to the Super Grub Disk web site and get the .iso for Super Grub 2 Disk (the all in one floppy/CD/USB one they list as recommended). If you have another PC, you can do this if/when calamity strikes, but if the dual boot machine is your only PC, it’s best to get this set up in advance in case you need it later (same goes for a backup USB/DVD). Use the program of your choice to write that image (the .iso file) to a USB drive or an optical disc (in Windows, I use Rufus to create bootable USB drives, while in Linux Mint, I use the built-in USB ISO writer).
Boot from that new disc or USB drive on the computer that needs help (BIOS or UEFI doesn’t matter. Use a UEFI boot if given the option on a UEFI setup). You’ll probably have to hit esc or F12 or some other key to get it to boot from something other than the hard drive, and in the menu that comes up, select your disc or USB.
The Super Grub 2 will start very quickly. From the menu, select “Detect and show boot methods.” It should be the default selection, so just press enter. In a few seconds, GRUB2 should show a list of boot options. You should see something like:
Linux /boot/vmlinuz-4.15.0-22-generic (hd2, gpt2)
in the list. The actual numbers will probably be different, since you will probably not be using the same kernel version as that, but that’s ok. There may be a bunch of them; just pick the top one with the highest version number, as that is most likely the kernel you had been using before disaster struck.
It will take a bit longer than a usual boot, and may fill your screen with text that goes so fast you can’t possibly read it all, but that’s ok. If it asks for root login for maintenance, or hit CTRL-D or whatever it is to continue, go ahead and press what it says to continue. If all goes well, you will see it boot into your Linux setup as usual (if you have a password set, it will ask for it). Log in as usual.
Once the login is done, start a terminal session (what would be called the command prompt in Windows), and type (on most distros, including Ubuntu and Mint):
sudo grub-install /dev/sda
That will reinstall the bootloader on your first hard drive. If you have more than one hard drive, you may have to change the /dev/sda to /dev/sdb or whatever the correct drive is, if the one you want to boot from isn’t the first. In the case of Mint, you can use the “disks” utility to look at the various drives and see which one is the right one before proceeding with the above. On other distros, there will surely be some tool that will do the same thing.
The GRUB devs, btw, suggest installing to ALL of the hard drives in the PC if you’re not sure. It won’t harm the ones that are not being used for booting, and that way, no matter which one is selected as the boot device, it will take you to the same place. That’s a little too imprecise for my liking, but it’s an option if you don’t know which boot device is the right one.
After you hit enter and your password, it should say “Found xx” or something like that, where xx is a Linux kernel version, once for every kernel you have installed (don’t worry about the actual numbers). It should also say “Found Windows (Loader)” or “Found Windows 7” or something like that, and then say it finished with no errors (we hope!).
Generally, that’s all you need to do to repair a dual-boot config that was messed up by Windows overwriting the bootloader. That command has worked in restoring dual boot for me every time I’ve tried when the dual boot was all that was messed up (it won’t, of course, repair issues that are not related to the bootloader).
There are a lot of Linux flavors out there, and some may not use “sudo.” That command is used to get administrative (root) rights for administrative operations that are beyond the scope of regular users… it’s the same as Windows popping up a User Account Control box asking if you want to allow something, only with the password (which is an option in Windows as well). If you’re using one of those distros, you will have to do some research first. Most will use sudo.
If this didn’t work, don’t give up… this barely scratches the surface of what kinds of repairs are possible. This is the fix for the most common dual-boot concern a lot of people have, which is the overwritten bootloader. Other things… just have a backup! The amount of stuff you can do to fix Linux is immense, and I have only begun to learn about all of it, but why bother with it if you don’t have to?
Dell XPS 13/9310, i5-1135G7/16GB, KDE Neon 6.2
XPG Xenia 15, i7-9750H/32GB & GTX1660ti, Kubuntu 24.04
Acer Swift Go 14, i5-1335U/16GB, Kubuntu 24.04 (and Win 11)