- Correctly identifying partitions and disks allows you to reinstall GRUB from a LiveUSB without reinstalling the system.
- Tools such as Boot-Repair, Syslinux, or LILO offer alternative ways to restore the MBR and boot manager.
- BCDBoot and bootrec allow you to repair Windows Boot Manager and the BCD store in multi-Windows environments.
- Combining Linux and Windows utilities makes it easier to safely recover any damaged dual boot.
When configuring a computer with dual boot between Windows and a Linux distribution (Ubuntu, Arch, Debian, etc.), the boot manager becomes a key component. It decides which system starts and how. The problem is that a simple Windows update, a change in partitions, or a reinstallation can cause this to happen. GRUB or Windows Boot Manager become damaged and the team stops starting as it should.
In these situations, it is common to encounter symptoms such as boot error screens, appearance of GRUB rescue modeYou want to have Windows boot only, ignoring Linux, or conversely, have Windows disappear from the menu. The good news is that, with the right tools, it's possible. Repair the bootloader (GRUB or Windows Boot Manager) in virtually any scenario, both in dual-boot Windows/Linux systems and in configurations with multiple versions of Windows.
What usually breaks GRUB or Windows Boot Manager in a dual-boot system
Before attempting any repairs, it's worth understanding why the starter is malfunctioning. This will give you a clearer picture. which tool to use in each case and you'll avoid repeating the same problem over and over again.
One of the most frequent reasons is that Windows overwrites the MBR or EFI partition When installed after Linux or after a major upgrade, Windows assumes it's the only operating system on the computer and rewrites the boot sector, so that GRUB disappears and only Windows boots..
Another very typical scenario is when partitions are resized or moved with partitioning tools. If you touch the partition where GRUB is installed or modify the partition table, it's easy for the boot manager to malfunction. lose reference to the Linux system root or the kernel itself and ends up displaying messages like "Boot system error" or not showing the operating system selection menu.
The manager can also become corrupted after a system updateAlthough it's not the most common occurrence, it's possible that a kernel update, a new GRUB package, or changes to the UEFI firmware leave the boot menu unconfigured and a rescue console appears directly (the famous prompt of grub rescue>).
On computers where several versions of Windows coexist (for example, Windows 10 and Windows 11 (on separate disks or in different partitions), sometimes the problem is not GRUB, but the system itself Windows BCD storewhich can be misconfigured and cause one of the systems to not appear in the Windows Boot Manager boot menu.
Boot from a Linux Live media to repair GRUB
When the boot manager fails and the system does not load normally, the most flexible course of action is to use a LiveCD or LiveUSB from a Linux distro (Ubuntu is usually the most convenient option) to "enter" the installed system and reinstall GRUB from there.
The first step is to create the bootable media. You need to download a ISO image of a distribution with GRUB2 (Ubuntu, Debian, Linux Mint, etc.) that matches the architecture of your damaged system: amd64 if your system is 64-bit or i386 if it is 32-bitThis coincidence is important because it will be used later. chroot And, if the architectures are not the same, errors may occur when running the GRUB binaries.
Once you have the ISO, you burn it to a Bootable USBYou can use tools like Rufus, balenaEtcher, or any other you're comfortable with. Insert the USB drive into the computer with the corrupted bootloader and, from the BIOS or UEFI, You choose to boot from the USB drive.
The first step is to create the bootable media. You need to download a ISO image of a distribution with GRUB2 (Ubuntu, Debian, Linux Mint, etc.) that matches the architecture of your damaged system: amd64 if your system is 64-bit or i386 if it is 32-bitThis coincidence is important because it will be used later. chroot And, if the architectures are not the same, errors may occur when running the GRUB binaries.
When you boot from the USB, the distribution menu will offer you something like “Try Ubuntu” (or “Try…” in English). This option loads a complete system into memory without touching the hard drive, and it is from there that you will be able to Open a terminal and run the necessary commands to restore GRUB..
On the Live desktop, simply open the applications menu and search "Terminal"From here on, the entire process is done from the command line, but if you follow the steps carefully, it's not too complicated.
Identify the root partition, the /boot partition, and the disk
To reinstall the boot manager, the first thing to know is On which partitions is your Linux installed? and what is the name of the disk where the MBR or EFI partition resides (for example, / Dev / sda).
From the Live system terminal you can use the command fdisk -l with administrator privileges: sudo fdisk-lThis command will list all connected drives and partitions, showing the file system type, size, and label if available.
Among all the output, you must locate which partition contains it. the root system of your LinuxYou'll usually see something like this. / Dev / sda2 or similar, with a reasonable size and a Linux file system type (ext4 or equivalent). If you previously created one separate /boot partitionYou will also need to identify it; it is usually a small partition where files such as grub, vmlinuz, initrd, System.map, etc.
If you have doubts, a simple strategy is manually mount the suspicious partitions and look at its content. For example, you can use sudo mount /dev/sda2 /mnt and then list the content with ls /mntIf you see directories like bin, boot, root, etcYou'll be looking at the root partition. If you mount another partition and find a folder inside, you'll see that. grub Along with other boot files, you will be looking at the partition / Boot.
At the top of the exit fdisk The name of the main album also appears, for example “Disk /dev/sdaThis identifier is key because it will be the final destination when reinstalling GRUB in the MBR or because it can point to the partition that acts as EFI in a UEFI system.
Mounting the partitions and using chroot to reinstall GRUB
Once you have identified the partitions that interest you, you need to mount them within the Live system to be able to "enter" your installation as if you had booted from it and not from the USB.
You start by assembling the root partition in /mnt with a command similar to: sudo mount /dev/sda2 /mnt (adjusting /dev/sda2 to the partition that corresponds in your case). If you have a partition / Boot Independently, you mount it within the tree of that root, for example with sudo mount /dev/sda7 /mnt/boot.
Then you need to mount some special directories using the option –bind This allows the chroot environment to see the device, processes, and file system of the computer. It's typically done with commands like: sudo mount –bind /dev /mnt/dev, sudo mount –bind /dev/pts /mnt/dev/pts, sudo mount –bind /proc /mnt/proc y sudo mount –bind /sys /mnt/sys.
With all that set up, you can now use chroot To change the root of the file system to that of your installed Linux system, the typical command is sudo chroot /mntFrom that moment on, all commands you execute will affect your actual system installed on the disknot to the Live environment that is running from the USB.
The next step is to reinstall GRUB on the correct disk. In BIOS/MBR systems, it is common to use a command like grub-install –boot-directory=/boot/ –recheck /dev/sda (replacing /dev/sda with the disk where the MBR is located). This command dumps the GRUB loader into the disk's boot sector and ensures that the configuration points to the correct files.
Once the manager is reinstalled, it is advisable Regenerate GRUB configuration so that it detects all available operating systems. That's done with grub-mkconfig -o /boot/grub/grub.cfgGRUB will scan the partitions for Linux kernels, Windows installations, and other systems, and generate the boot menu.
When you're finished, all you have to do is exit the chroot with the command exit and restart the computer with sudo rebootUpon removing the bootable USB drive, the system should display again. a fully functional GRUB menuallowing you to boot both Linux and Windows.
Use Boot-Repair to automatically recover GRUB
For those who don't want to struggle with so many manual commands, there is a very practical tool called Boot Repair, specially designed for Fix common boot problems in Ubuntu and derivatives.
Boot-Repair is a utility that can be installed in an Ubuntu environment (either the operating system itself or a Live environment). Its main function is reinstall GRUB automatically and restore access to all installed systems: whether because Windows has overwritten the MBR, because an update has stopped showing the GRUB menu, or because you have messed with partitions and the configuration has been broken.
In addition to standard repair, the tool features Advanced Options to back up partition tables, back up boot sectors, generate detailed reports (Boot-Info) and adjust repair parameters if you need finer control.
To use it in an Ubuntu Live environment, you first need to Add the Boot-Repair PPA repository with a command like: sudo add-apt-repository ppa: yannubuntu / boot-repairThe packages are then updated with sudo apt update and finally the application is installed with sudo apt install boot-repairIf the system prompts you, confirm the download and installation.
Once the utility is installed, it can be launched from the Ubuntu application search engine by typing “Boot-Repair”Upon startup, the tool itself usually displays an option to "Recommended repair"which is the most convenient for most users, as it takes care of Reinstall GRUB, update its configuration, and fix most typical errors without needing to configure anything manually..
In the advanced options there is a checkbox for “Restore MBR”This option allows you to replace the disk's current boot gesture with a generic or specific MBR, which can be useful in certain scenarios. After selecting the appropriate option and clicking on "Apply"Boot-Repair initiates the repair process and displays its progress until completion. Once finished, it typically indicates the changes made and, after a restart, the Dual boot should be operational again..
Other low-level tools: Syslinux, MBR, and LILO
In some advanced cases, especially when working with specific configurations, older hardware, or specific file systemsIt may be useful to use tools like Syslinux or LILO to manipulate the MBR and boot process more directly.
syslinux It is a set of lightweight starter chargers that serve different scenarios: the classic SYSLINUX for MS-DOS FAT file systems, PXELINUX for network boot, ISOLINUX for bootable CDs, and EXTLINUX for ext2/3/4 or btrfs file systems. It also includes MEMDISK, which allows booting older operating systems like DOS from non-traditional media.
On a distro like Ubuntu, it can be installed with sudo apt install syslinuxOnce installed, it is possible restore the MBR writing the corresponding code at the beginning of the disk, for example with sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdaAlternatively, other packages and tools can be used, such as sudo apt-get install mbr followed by sudo install-mbr -in -p D -t 0 /dev/sdawhich also restore a functional MBR.
Another classic option is LILO (Linux Loader)Although GRUB2 is the default bootloader in most distributions today, LILO is still... a simple and robust solution for certain types of hardware or specific configurations where GRUB is more problematic. In Ubuntu, for example, it can be installed with sudo apt-get install liloDuring installation, a message will appear on the screen that you must accept to continue.
After having LILO installed, it can be used to write a new MBR with a command of the type sudo lilo -M /dev/sda mbrThis replaces the MBR code with LILO code, which can help restore a working boot on computers where the boot manager has become corrupted or incompatible with the hardware.
Repairing GRUB when rescue mode appears in Arch Linux
In distributions like Arch Linux It is relatively common to encounter the mode Grub Rescue. After Windows updates your system, changes the boot configuration, or modifies the partitions, the computer boots, but instead of the GRUB menu, a minimalist prompt appears where only a few commands can be executed.
From that way you can try manually boot Arch Linux indicating to the manager where the kernel and its configuration are located. A typical example involves setting the GRUB root and prefix with something like set root=(hd0,gpt8) y set prefix=(hd0,gpt8)/boot/grub, load the normal module with normal insmod and finally, execute normal so that it points to the usual menu.
That allows you to get out of a bind temporarily, but it doesn't fix the underlying problem. The proper way is, once Arch is booted, to run a grub-install pointing to the correct disk (for example, sudo grub-install /dev/sda) and later grub-mkconfigHowever, sometimes this command fails with messages like “unable to identify a filesystem in hostdisk” or that it cannot perform security checks on the disk.
When that happens, the wisest thing to do is boot from a compatible Live media (such as the Arch installer itself or a Live from another distro), mount the partitions and use chroot as described earlier. This way you can ensure that The devices are available correctly, the partition table is detected correctly, and GRUB can be reinstalled without problems.It is important to verify that you are installing GRUB in the entire disk device (for example /dev/sda) and not on a specific partition (/dev/sda6), unless you have a very specific reason to do so.
Restoring Windows Boot Manager and the BCD on dual-boot systems
In settings where they coexist two versions of Windows (for example, Windows 10 and Windows 11) or where only the Windows boot has broken within a dual-boot with Linux, it may also be necessary Repair the Windows boot manager and its BCD store.
Windows includes a utility called BCDBoot That works for Create or repair boot entries for a Windows-based systemThis is very useful when you have installed a second Windows on another partition or disk and, when booting, it does not appear in the menu; or when the boot menu has been deleted and it only enters one system.
The general procedure consists of starting the PC with a Windows installation media (or a recovery drive) and access the repair options. On the installation screen, instead of continuing with the usual process, click on “Repair the equipment”From there you enter "Solve problems" and later "Advanced Options"where you can select "Symbol of the system" or directly “Startup Repair”as needed.
If you choose automatic repair, the option “Startup Repair” will automatically attempt to correct errors in the boot manager and in the BCD configurationIt's a quick way to recover Windows Boot Manager in many cases without having to manually type commands.
If things require more control, you can use the console Recompile the BCD storeA typical procedure is, firstly, to make a copy of the current store with something like ren BCD BCD.old (after navigating to the correct folder), and then run bcdboot D:\Windows (replacing D:\Windows with the actual path to the Windows installation you want to add). If you don't know which letter corresponds to each partition, you can use diskpart & AFTER list volume to see the assigned letters.
It is also possible to specify the language and boot volume using a more complete syntax, such as bcdboot c:\Windows /l en-us /s X: /f ALL, substituting X: by the letter of the boot partition (or of a flash drive where you want to create the bootloader). This rewrites the BCD with clean entries for the chosen Windows version, so that upon restarting Both systems should appear in the menu. if the rest of the configuration is correct.
Repair the Windows MBR with bootrec
In situations where the problem lies directly in the MBR (Master Boot Record) From a disk that has been used as a boot drive in Windows, you can also use the tool bootrec, available in Windows recovery environments.
The process usually begins by starting from the Windows installation mediaOn many Dell computers, for example, you can press the F12 key on the home screen to open the boot menu and select the installation USB or DVD. Once inside, just as before, press on “Repair the equipment”, one enters "Solve problems", Then in "Advanced Options" and finally it is selected "Symbol of the system".
From the console, you can execute a series of bootrec commands In this order to repair the MBR and BCD storage: first bootrec / fixmbr, which writes a clean Windows-compatible MBR to the disk; then bootrec / fixbootwhich creates a new boot sector in the system partition; and finally bootrec / RebuildBcd, which analyzes existing Windows installations and offers to add them to the boot store.
Once these commands work without errors, the computer is restarted by removing the installation media to check if Windows boots correctly and, if applicable, whether dual booting with Linux is still accessible via GRUB or Boot Managerdepending on how the system is configured.
Knowing all these tools and procedures (LiveUSB of Linux, chroot and GRUB reinstallation, using Boot-Repair, Syslinux, LILO, BCDBoot and bootrec) makes it much easier diagnose which boot component has broken in a dual-boot system and apply the appropriate solution In each case, avoiding complete system reinstalls and recovering a stable dual boot between Windows and your favorite Linux distribution in just a few steps.