• An easy fix to most dual-boot troubles

    Home » Forums » AskWoody support » Linux for the Home user » Linux – all distros » An easy fix to most dual-boot troubles

    Author
    Topic
    #196417

    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)

    1 user thanked author for this post.
    Viewing 1 reply thread
    Author
    Replies
    • #196462

      One question about creating an ISO disk I have been hoping for a chance to ask someone here:

      I have in my PC’s hard disk, let’s say, a total of 250 GB occupied, counting everything that’s mine, the system’s, plus anything else installed there. So if I am making a complete image of all that, I might need a storage device with a 250 GB storage capacity to save that image. Of course, the whole thing could be compressed first, which means less space will be needed in the external device, but that space still is going to be pretty big.

      What might be the best thing to do in such a case?

       

      Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

      MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
      Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
      macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

      • #196463

        Images are usually compressed. If you have somewhere between 1T and 2T external drive, you should have plenty of room. If you do an image once a month before updates, you could easily keep at least 4-5 images.

        If I have to go back farther than that, I might as well reinstall.

        1 user thanked author for this post.
        • #196489

          PK, Thank you. Your have clarified something I’ve been wondering for a while: how best to create an ISO when the total occupied space on the hard disk is very large. So it is quite simple, after all.

          Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

          MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
          Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
          macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

    • #196486

      Ascaris:

      Thanks for this tutorial.  I will look for that software.

      Fortunately, I have never had a Windows/Linux dual boot issue, but have had a number of Linux/Linux dual boot issues, which at that stage of my Linux explorations could not resolve.

      Usually one distro or the other would get corrupted (usually the first or oldest install), but I suspect the installers are far more developed that those days, as a Linux install is now easier than Windows, and some of the distros were not common flavors (Sabayon was problematic).

      I find the Linux advice given here on AskWoody is a lot more understandable than one sometimes encounters on the distro forums.

      Still moving towards Group L.

    Viewing 1 reply thread
    Reply To: An easy fix to most dual-boot troubles

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: