MP3 – mintCast artwork

383.5 – Bootloader Boot Camp

MP3 – mintCast

English - June 12, 2022 01:46 - 1 hour - 45.3 MB - ★★★★★ - 15 ratings
Technology Homepage Download Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed


In our Innards section we discuss tips and tricks around GRUB, as well as a couple alternatives.


Download

0:32 Linux Innards

56:54 Check This Out

1:01:28 Announcements


In our Innards section we discuss tips and tricks around GRUB, as well as a couple alternatives.


Twitter. Discord. Telegram. Matrix. Reddit. Youtube.



Linux Innards

GRUB bootloader, troubleshooting, tips & tricks, alternatives


Lines in the standard configuration file for Grub:

GRUB_TIMEOUT=5

the length of time in seconds that you will see the bootloader menu

GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,,g’ /etc/system-release)”

extracts the release information from the /etc/system-release file and makes names in the grub menu

GRUB_DEFAULT=saved

can be used to set the default kernel that is booted, usually the most recent kernel but you can change it to a later number instead of 0 and that will be the default one to get loaded.  If a new kernel is installed then your list is iterated

GRUB_SAVEDEFAULT=

not normally used, but if set to true, then every time you select a different kernel at boot then that will be the new default instead of just a one time load

GRUB_DISABLE_SUBMENU=true

Submenus are used to pick things like a testing kernel or a safe mode kernel.  Setting to false gets rid of this

GRUB_TERMINAL_OUTPUT=”console”

can be used to redirect output to another terminal.  I have never used this

GRUB_CMDLINE_LINUX=”rd.lvm.lv=fedora_fedora25vm/root rd.lvm.lv=fedora_fedora25vm/swap rd.lvm.lv=fedora_fedora25vm/usr rhgb quiet”

contains the cmd line arguments that will be passed to the kernel.  Will be used for all installed kernels.  Removing quiet gives terminal output to help diagnose issues in boot sequence

GRUB_DISABLE_RECOVERY=”true”

Set to true or false to add recovery entries

Source: https://opensource.com/article/17/3/introduction-grub2-configuration-linux#:~:text=GRUB%20stands%20for%20GRand%20Unified,it%20is%20no%20longer%20needed.

That is a broad overview of a standard grub setup.

GRUB troubleshooting

When grub can’t see any of your kernels and dumps you to a grub rescue prompt, it means that grub is working but it can’t find an actual linux distro anywhere.
You will need to find the vmlinuz and initrd files, which are usually in /boot.
Then enter the commands:

set root=*the drive you found*
linux “path to vmlinuz” root=/dev/”where its mounted”
initrd “path to initrd”
boot

Your system should boot.  This is a one time fix and you will need to reinstall grub before rebooting or you will need to do it all again.  You can do this using sudo grub-install /dev/”where its mounted”

With any manual changes to your grub always remember to use sudo update-grub
You may also need ‘echo GRUB_DISABLE_OS_PROBER=false|sudo tee -a /etc/default/grub && sudo update-grub’
In order to re enable os prober

Londoner sent this video from “Thor” for fixing a Linux kernel panic, on Manjaro and Endeavour installations on a multiboot system with Mint controlling GRUB.

systemd-boot (alternative boot menu for UEFI systems)

These instructions are for replacing GRUB with systemd-boot.
First, execute the command “sudo bootctl install”

This will copy the systemd-boot boot loader to the ESP: on a x64 architecture system /usr/lib/systemd/boot/efi/systemd-bootx64.efi will be copied to esp/EFI/systemd/systemd-bootx64.efi and esp/EFI/BOOT/BOOTX64.EFI, and systemd-boot will be set as the default EFI application.
If you have your EFI system partition mounted somewhere else other than the boot partition, you can specify these locations by executing the “sudo bootctl –esp-path=/efi –boot-path=/boot install” command.

Next, you need to enable the systemd service which will update the bootloader if and when there is an update to the systemd stack.

Execute “sudo bootctl update”

There are two types of tiny config files you have to write to get this to work, and on a single boot system there will only be two files total. You have to write a loader.conf, and an entry file for each operating system. As I said – if you only have one operating system, you’ll only have one entry file.
In the  esp/loader/ directory, create the file loader.conf and add the following:

default  name of your operating system.conf
timeout  4
console-mode max
editor   no

In the esp/loader/entries/ folder, add the file name of your operating system.conf and add the following:

title – operating system name. Required.
version – kernel version, shown only when multiple entries with the same title exist. Optional.
machine-id – machine identifier from /etc/machine-id, shown only when multiple entries with the same title and version exist. Optional.
efi – EFI program to start, relative to your ESP (esp); e.g. /vmlinuz-linux. Either this parameter or linux (see below) is required.
options – space-separated command line options to pass to the EFI program or kernel parameters. Optional, but you will need at least root=dev if booting Linux. This parameter can be omitted if the root partition is assigned the correct Root Partition Type GUID as defined in

An example of a well written entry configuration would look like this:

title   Linux Mint
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=”/dev/sda1″ rw quiet

Once these files are written, you can safely remove GRUB from your system, and it may be a good idea to delete the GRUB directory from the EFI system this way it removes possible confusion when telling the UEFI what boot entry to load.
As I said, consult online documentation and be sure you understand what you are doing before attempting to replace any bootloader, as a mistake can leave your machine in an unbootable state. I recommend practicing in a virtual machine, using the exact same operating system you have installed on bare metal several times before attempting to do it on your system.

rEFInd (alternative boot menu for UEFI systems)

Distros usually install GRUB to different directories, you might have multiple ones
GRUB is both a boot manager (presents menu) and a bootloader (loads kernel)
rEFInd is a boot manager, but not a boot loader
“In theory, EFI implementations should provide boot managers”
all EFI-capable OSes include one, so the above limitation isn’t a problem
since version 3.3.0, the kernel can function as an EFI boot loader for itself

Installing rEFInd: apt install refind and sudo refind-install
rEFInd fully lives on the EFI partition, once installed on it.
refind.conf – a single configuration file (timeout, log level, background, icons, text,font, custom menu entries are optional, not necessary)
Scans your drives at every boot, lists bootable entries (bootloaders, kernels)
refind_linux.conf – separate config file in the /boot dir of each distro, boot options

Check This Out

Audio Sharing (a new Gnome Circle app)
The “stat /” command lets you check when your system was installed
How to stop video tearing in XFCE without the use of an alternative compositing manager.

xfconf-query -c xfwm4 -p /general/vblank_mode -s glx

Wrap-up

Joe – Tllts.org, linuxlugcast.com, MeWe, [email protected], Buy Joe a coffee
Norbert – [email protected]
Josh T – [email protected], Josh Thacker on Discord, and @Metal_FOSS on Twitter
Nishant – [email protected],riconghost on instagram, riconghost@Github, Ghost.Ricon on DIscord, maverick00783 @ Steam
Moss – [email protected], you can hear me on Distrohoppers’ Digest and Full Circle Weekly News, and you can find more contact information for me on It’s MOSS.
Bill – [email protected], @wchouser3 on Twitter,and Bill_H on Discord

Before we leave, we want to make sure to acknowledge some of the people who make mintCast possible:

Norbert and Tony H for our audio production
Leo for timestamps and publishing
Josh Lowe for all his work on the website
Hobstar for our logo
initrd for the animated Discord logo
Londoner for our time sync
Bytemark Hosting for hosting mintcast.org and our Mumble server
Archive.org for hosting our audio files
HPR for our backup Mumble room
The Linux Mint development team for the fine distro we love to talk about.Thanks, Clem!

Twitter Mentions