My bootloader/startup program no longer works! - My bootloader/startup program no longer works! - TUXEDO Computers

  ATTENTION: To use our store you have to activate JavaScript and deactivate script blockers!  
Thank you for your understanding!

My bootloader/startup program no longer works!

The grub boot loader is a central element in the Linux ecosystem for the operating system’s boot process. Despite its reliability, occasional glitches can occur, whether due to updates, kernel changes, or system failures. This guide provides help in repairing the Grub boot manager of TUXEDO OS, OpenSUSE and Ubuntu (and derivatives) in a chroot environment.

TUXEDO OS

With TUXEDO OS we have introduced a significant simplification as far as creating a chroot is concerned. With the TUXEDO Chroot Helper you create a chroot with a few mouse clicks and without entering any commands. You can find the tool in the live medium of TUXEDO OS in the main menu under the menu item TUXEDO. We explain how to create a chroot environment with it in a separate article in the documentation of TUXEDO OS.

openSUSE

For openSUSE, you can find the necessary steps as well as detailed instructions in the distribution’s online manual.

Ubuntu

Preparations

Step 1: Create bootable USB stick with TUXEDO OS

You need a USB stick or a CD/DVD with a live system. If you do not have such a boot medium yet, the instructions Create live boot medium will help you.

Step 2: Boot computer as live system with TUXEDO OS

Start the live medium on your device. Here you have to note that the live medium is also booted in UEFI mode if the installed system (whose bootloader you want to recover) is also installed with UEFI.

Step 3: Determine the Device ID of the Boot Partition

You now create a chroot environment with your system in the terminal. Since all commands must be executed with root privileges, use sudo -s to obtain permanent administrative privileges. From then on, all entries in the terminal will be executed without the usual preceding sudo. Afterwards you inform yourself about the available hard disks and partitions (the output looks like this or something similar).

lsblk
(out)NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
(out)sr0     11:0    1  1024M  0 rom
(out)sda      8:0    0 232,9G  0 disk
(out)├─sda4   8:4    0 174,4G  0 part
(out)├─sda2   8:2    0     8G  0 part SWAP
(out)├─sda3   8:3    0    50G  0 part
(out)└─sda1   8:1    0   512M  0 part

You identify the partitions by their size: The EFI partition is always 512M in size, listed here as sda1. For older pre-installations of TUXEDO Computers machines or WebFAI installations, the root partition / was always 50G in size, for example, which would be sda3 here. In more recent installations, we no longer use a separate partition for the partition /home. The device ID of the root partition / corresponds to the largest partition there.

Step 4: Define variables for simplification

For convenient further operation, create temporary variables and enter the device paths according to the info from the previously mentioned command lsblk. Do not forget to adjust the device IDs in the commands.

myefi=/dev/sda1
myroot=/dev/sda3

Devices with UEFI enabled

You now mount the root partition and prepare other functions for the chroot environment. Then mount the EFI partition, switch to the chroot and reinstall Grub there.

Step 1: Mounting the root and EFI partitions
mount $myroot /mnt
mount $myefi /mnt/boot/efi
Step 2: Preparation of further functions for the chroot environment
for i in dev dev/pts proc sys sys/firmware; do mount --bind /$i /mnt/$i; done
mount -o bind /etc/resolv.conf /mnt/etc/resolv.conf
Step 3: Change into chroot environment
chroot /mnt
Step 4: Update and reinstall the bootloader
apt-get --reinstall install grub-common grub-efi-amd64 os-prober
update-grub
grub-install
Step 5: Exit Chroot environment

Finally you can leave the chroot environment by typing exit twice and reboot the system with reboot. At the next start the boot manager Grub should appear again. If not, check the boot sequence in the BIOS again and change it if necessary.

Devices without UEFI

Step 1: Mount the root and the EFI partition
mount $myroot /mnt
Step 2: Preparing other functions for the chroot environment
for i in dev dev/pts proc sys sys/firmware; do mount --bind /$i /mnt/$i; done
mount -o bind /etc/resolv.conf /mnt/etc/resolv.conf
Step 3: Switch into the chroot environment
chroot /mnt
Step 4: Update and reinstall the bootloader
apt-get --reinstall install grub-common grub-efi-amd64 os-prober
update-grub
Important: Adapt the following command for the hard disk or SSD installed in your computer and replace sda with sdb or the corresponding device ID if necessary. Select the hard disk (e.g. /dev/sda) and not one of the partitions on the hard disk. Normally one selects here the hard disk, on which also the system is. In the BIOS this hard disk must also be in the first place in the boot sequence.
grub-install /dev/sdX
Step 5: Exit Chroot Environment

Finally you can leave the chroot environment by typing exit twice and reboot the system with reboot. At the next start the boot manager Grub should appear again. If not, check the boot sequence in the BIOS again and change it if necessary.