Introduction to grub 2
Introduction to grub 2
GRUB 2 Destination
BIOS-based
/boot/grub2/grub.cfg
UEFI
/boot/efi/EFI/redhat/grub.cfg
Menu Entries in grub.cfg
menuentry 'Red Hat Enterprise Linux Server' --class red --class gnu-linux --class gnu --class os |
linux on 64-bit IBM POWER Series, linux16 on x86_64 BIOS-based systems, and linuxefi on UEFI-based systems.
The initrd directives followed by the path to the kernel and the initramfs image respectively.
Configuring GRUB 2 to Require a Password only for Modifying Entries
-
Run the grub2-setpassword command as root:
grub2-setpassword
-
Enter and confirm the password:
Enter password:
Confirm password:
Following this procedure creates a /boot/grub2/user.cfg file that contains the hash of the password. The user for this password, root, is defined in the /boot/grub2/grub.cfg file. With this change, modifying a boot entry during booting requires you to specify the root user name and your password.
Changing the Default Boot Entry
GRUB 2 supports using a numeric value as the key for the saved entry directive to change the default order in which the operating systems are loaded. To specify which operating system should be loaded first, pass its number to the grub2-set-default command. For example:
~]# grub2-set-default 2 |
To force a system to always use a particular menu entry, use the menu entry name as the key to the GRUB_DEFAULT directive in the /etc/default/grub file. To list the available menu entries, run the following command as root:
~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg |
Rebuilding the grub.cfg file
Changes to /etc/default/grub require rebuilding the grub.cfg file as follows:
On BIOS-based machines, issue the following command as root:
~]# grub2-mkconfig -o /boot/grub2/grub.cfg |
On UEFI-based machines, issue the following command as root:
~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg |