Select font size:          

 

Boot repair tools on Linux

Tools and commands relevant for boot repair

In this article we are going to show you how to use the tool boot-repair. Furthermore we will list some further tools which might be helpful for trouble shooting. Even if our example refers to Debian or derivates like Ubuntu in the first place, it can be widely used with other Linux distributions in combination with Windows.

If you install Windows first and then Linux, you will normally not encounter any problem. But if you touch Windows again and put the Windows boot loader in the boot sector you will want to restore the old GRUB boot menu. In my case it didn’t work with the grub tools (update-grub, grub-install). I had to use boot-repair in order to repair the boot sector.

boot-repair

The easiest solution would be to download the iso of the live-OS of Boot-Repair here: https://sourceforge.net/projects/boot-repair-cd/

Put it on a USB stick, for instance using Rufus (on Windows) or Ventoy (on Linux or Windows), if you are using Windows, see at the bottom of this page.

Otherwise you can install boot-repair directly on your Linux system.

Example: install boot-repair on Ubuntu

Please note that if the add-apt-repository command is missing it means that certain packages have to be installed:


sudo apt-get install software-properties-common python-software-properties

Once these packages are installed you can install boot-repair as follows:


sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
sudo boot-repair

Click "Recommended repair" and follow the instructions.

Reboot the PC. Now you should get a GRUB menu with access to both Ubuntu and Windows. If any problem, indicate the new URL.


and then:


sudo update-grub
sudo fdisk -lu

If it does not work:


sudo grub-install /dev/[BOOT PARTITION eg. Sda6]
sudo os-prober
sudo update-grub

Then reboot.

Grub-tools


sudo grub-install /dev/[BOOT PARTITION eg. Sda6]
sudo update-grub

Check Repairing Grub with a Rescue CD for a detailed description about how to repair Grub with the a Linux live system for rescue purposes.

bootinfoscript

bootinfoscript is a bash script which searches all hard drives attached to the computer for information related to booting and displays it in a convenient format. Its primary use is for troubleshooting booting problems.

https://bootinfoscript.sourceforge.net/

os-prober

One of the installer's features is that it can probe disks on the system for other operating systems, and add them to the boot loader, so that installing Debian doesn't make your other installed OS hard to boot.


sudo apt-get install os-prober
sudo update-grub
sudo os-prober

fdisk

fdisk -l lists all partitions

The option -l lists the partion table: sudo fdisk -lu

The option -u shows sizes in sectors instead of cylinders: sudo fdisk -l


Super Grub2 disk

If your purpose is just to boot Windows quickly, independently from the reparation, just download SuperGrub and boot it.

Check SuperGrub2 Disk for more information about how to use SuperGrub2 disk.


Check for more Linux related articles.