1.6 KiB
1.6 KiB
LPIC-1 102.2: Installing a boot manager
Changing GRUB's settings, regenerating grub.cfg, adding a custom menu
entry, and using the GRUB menu and command line.
Before you start
Take a snapshot first: this lab changes the boot loader's configuration.
The lab saves /etc/default/grub, /etc/default/grub.d/ and
/etc/grub.d/40_custom; reset puts them back and regenerates grub.cfg.
To see the GRUB menu you need the VM's console, not SSH.
Tasks
- Change
GRUB_TIMEOUTto 10, regenerategrub.cfg, and reboot to see it. - Add a kernel option at the menu with e for one boot, then check
/proc/cmdline. Check it yourself: the option shows in/proc/cmdlinefor that boot only. - Copy an entry from
grub.cfginto/etc/grub.d/40_custom, change its title, regenerate, and boot it. On AlmaLinux,grub.cfghas no entries to copy: write the entry from one of the files in/boot/loader/entries/instead. - Open the GRUB command line with c and find your kernel with
ls. Check it yourself:ls (hd0,gpt3)/or similar lists avmlinuzfile.
Hints
/etc/default/grub; on Ubuntu cloud images a file in/etc/default/grub.d/setsGRUB_TIMEOUTagain, after it, andGRUB_TIMEOUT_STYLE=hiddenhides the menu.grub2-mkconfig -o /boot/grub2/grub.cfgon the RHEL family,update-grubon Debian and Ubuntu.- A
menuentry 'Title' { ... }block keeps itslinuxandinitrdlines; on AlmaLinux they come from thelinux,optionsandinitrdlines of a BLS entry. grub2-rebootorgrub-rebootwith the title boots an entry once.