56:54 Check This Out
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=5the length of time in seconds that you will see the bootloader menuGRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,,g’ /etc/system-release)”extracts the release information from the /etc/system-release file and makes names in the grub menuGRUB_DEFAULT=savedcan 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 iteratedGRUB_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 loadGRUB_DISABLE_SUBMENU=trueSubmenus are used to pick things like a testing kernel or a safe mode kernel. Setting to false gets rid of thisGRUB_TERMINAL_OUTPUT=”console”can be used to redirect output to another terminal. I have never used thisGRUB_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 sequenceGRUB_DISABLE_RECOVERY=”true”Set to true or false to add recovery entriesSource: 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 troubleshootingWhen 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”bootYour 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-grubYou may also need ‘echo GRUB_DISABLE_OS_PROBER=false|sudo tee -a /etc/default/grub && sudo update-grub’In order to re enable os proberLondoner 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.conftimeout 4console-mode maxeditor noIn 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 inAn example of a well written entry configuration would look like this:title Linux Mintlinux /vmlinuz-linuxinitrd /intel-ucode.imginitrd /initramfs-linux.imgoptions root=”/dev/sda1″ rw quietOnce 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 onesGRUB 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 problemsince version 3.3.0, the kernel can function as an EFI boot loader for itselfInstalling rEFInd: apt install refind and sudo refind-installrEFInd 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 optionsCheck This Out
Audio Sharing (a new Gnome Circle app)The “stat /” command lets you check when your system was installedHow to stop video tearing in XFCE without the use of an alternative compositing manager.xfconf-query -c xfwm4 -p /general/vblank_mode -s glxWrap-up
Joe – Tllts.org, linuxlugcast.com, MeWe, [email protected], Buy Joe a coffeeNorbert – [email protected]Josh T – [email protected], Josh Thacker on Discord, and @Metal_FOSS on TwitterNishant – [email protected],riconghost on instagram, riconghost@Github, Ghost.Ricon on DIscord, maverick00783 @ SteamMoss – [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 DiscordBefore we leave, we want to make sure to acknowledge some of the people who make mintCast possible:
Norbert and Tony H for our audio productionLeo for timestamps and publishingJosh Lowe for all his work on the websiteHobstar for our logoinitrd for the animated Discord logoLondoner for our time syncBytemark Hosting for hosting mintcast.org and our Mumble serverArchive.org for hosting our audio filesHPR for our backup Mumble roomThe Linux Mint development team for the fine distro we love to talk about.Thanks, Clem!