How do I fix Ubuntu in Grub

Grub 2: How to Optimize the Linux Boot Manager

2. Repair Grub 2

If Grub 2 reports errors but the system still boots, reinstall Grub 2. Use the following command lines on a BIOS system:

Instead of “x”, enter the name of the boot hard disk. If you only have one hard drive, use “sda”. For example, if Linux is installed on "/ dev / sdb" and Windows on "/ dev / sda", you can also specify the Linux hard drive as the destination. Put the Linux hard disk first in the list of boot devices in the BIOS. You can then start Linux or Windows via the Grub boot menu. The advantage: If you reinstall Windows, the Grub boot loader remains on the Linux hard drive.

Rescue system for Grub 2: If the computer does not start anymore, for example because the boot loader was overwritten by a Windows installation, use Super Grub 2 Disk. Download the ISO file and write the image to a USB stick:

Replace "file name" with the actual name of the downloaded file and replace "x" with the device ID of the stick. All files on it will be lost. Then boot the PC from the USB stick and go to "Detect and show boot methods" in the menu. Select the system you want to start with. In the installed system then repair Grub 2 and the EFI files:

You do not specify a target drive. The script finds the directory “/ boot / efi” automatically.

Use Live DVD: This article explains how to boot the PC from a Linux installation DVD in an emergency. To reinstall Grub, mount the file systems with the following lines:

Replace “System” with the integration point of the installed Ubuntu under “/ media / ubuntu /”. With a Uefi system, you also mount the EFI partition

Replace “xy” with the path to the EFI partition. If you don't know this, use sudo parted -l. The tool shows the list of all partitions. Run the following four command lines:

“System” again stands for the mount point of the Ubuntu partition, for “x” you enter the path to the boot drive. If you have a Uefi system, leave out “/ dev / sdx”.

Repair with emergency system: Rescatux makes defective and overwritten bootloaders work again, but is only suitable for BIOS systems, as it cannot boot in Uefi mode. After starting, call up the desired action in the Rescapp tool. There are, for example, “Restore Grub” and “Update Grub Menus”. The “Boot Repair” tool repairs the Grub boot environment with one click of the mouse.