Skip to main content
LPIC-1 Exam 101

102.2 Install a boot manager, part 2

By January 26, 2014September 12th, 2022No Comments
Weight 2
Description Candidates should be able to select, install and configure a boot manager

Key Knowledge Areas:

  • Providing alternative boot locations and backup boot options.
  • Install and configure a boot loader such as GRUB Legacy.
  • Perform basic configuration changes for GRUB 2.
  • Interact with the boot loader

Terms and Utilities

  • /boot/grub/menu.lst
  • grub-install
  • MBR
  • superblock

In part 1 we looked at installing and managing GRUB now we look at GRUB2

GRUB has served as long and well for many years. GRUB2 has been around for a little while in openSUSE and Ubuntu but we now see it in Enterprise Linux with its first showing with Red Hate Enterprise Linux 7 and the default boot loader. In many respects GRUB2 is similar but the configuration file is very much more complex and generated with grub2-mkconfig (/sbin/grub2-mkconfig). The configuration file now has or more standard name, /boot/grub2/grub.cfg but it is not edited directly. The configuration comes from the /etc/default/grub file and the directory /etc/grub.d/ . It is here we would add our own entries, but new kernels and ram disks are detected and added to the menu automatically.

To set the menu timeout we can edit the /etc/default/grub file and change the value to whatever we need..

GRUB_TIMEOUT=5

If we need to change the default menu item, this can be achieved via the following command.

grub2-set-default 1

This would set the second item in the menu to be the default, counting from 0. After any change we need to regenerate the grub.cfg

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