Loading...
X

How to update the GRUB bootloader in Arch Linux and derivatives (Manjaro, BlackArch)

The GRUB operating system loader is installed and updated on Linux like any other software package. But the peculiarity of the bootloader is that even after updating the package, the actual working files of the bootloader, which are located on the partition mounted along the /boot/grub/ path, are not automatically updated.

That is, when new versions of GRUB are released, the package in your OS is updated automatically.

But the bootloader itself, which is installed on a separate disk partition and mounted along the /boot/grub/ path, is not updated.

To start using the new features that are added in new versions of GRUB, you need to manually update the bootloader.

When to update the GRUB bootloader in /boot/grub/

The signal that a new version of GRUB has been released is something like the following message:

(3/4) upgrading grub                               [######################] 100%
:: To use the new features provided in this GRUB update, it is recommended
   to install it to the MBR or UEFI. Due to potential configuration
   incompatibilities, it is advised to run both, installation and generation
   of configuration:
     $ grub-install ...
     $ grub-mkconfig -o /boot/grub/grub.cfg

This message says that in order to use the new features introduced in this GRUB update, it is recommended to install it in MBR or UEFI. Due to potential configuration incompatibilities, it is recommended that you perform both installation and configuration creation. And also given exemplary commands.

That is, if you see this message, then you need to update the bootloader in /boot/grub/.

How to check if GRUB is being used on the operating system

On Arch Linux and derivative distributions, the GRUB package can be installed but is not used because the bootloader is systemd-boot.

To verify that GRUB is the bootloader, run the following command:

ls -l /boot/grub/grub.cfg

If the /boot/grub/grub.cfg file is found, then GRUB is being used, if the grub.cfg file is not found, then GRUB is not used and does not need to be updated. That is, you do not need to follow the steps shown in this article!

For details, see the article: How to check if a computer is using BIOS or UEFI; GRUB or systemd-boot bootloader; MBR or GPT partition table

How to update the GRUB bootloader in /boot/grub/

To update the bootloader, you need to run a command like:

grub-install --recheck /dev/DISK

Where /dev/DISK should be the name of your drive.

Drive names can be checked with the command:

fdisk -l

Example output:

Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4b23ea92

Device     Boot  Start      End  Sectors  Size Id Type
/dev/vda1  *      2048   411647   409600  200M 83 Linux
/dev/vda2       411648 62914559 62502912 29.8G 83 Linux

In this case, the drive name is /dev/vda. Note that /dev/vda is not a boot partition or some other partition – it's the entire drive.

So, the command to update GRUB in /boot/grub/ in my case is the following:

grub-install --recheck /dev/vda

You also need to create a new configuration file with the following command:

grub-mkconfig -o /boot/grub/grub.cfg

Example output:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

GRUB bootloader update and GRUB configuration update completed successfully. The next time you boot, your operating system will use the new features that were added by the GRUB update.


Leave Your Observation

Your email address will not be published. Required fields are marked *