Now, if that wasn't enough excitement for you, we've got loads more planned.
We're going to be taking a look, yes,
yes, just calm down just a little bit, we're going to be
taking a look at the /etc/default/grub file.
Now in here, we've got the timeout.
When we look at GRUB,
it will display for a certain amount of time, and
then it will take the default entry.
So here, we can see it's set to 5 seconds.
We can take a look at the GRUB_DISTRIBUTOR, and with this, we'll actually
then go through and work out what distribution we're working with by
extracting some information from the system‑release file.
We can go through and take a look at that and see what sed is
doing. The GRUB_DEFAUT = saved, so the entry is going to be the
last one used, but we see that's also going to change when we go
through and put a new kernel in.
The new kernel will automatically become the default entry. Here,
we're disabling any submenus. You can have menu items,
items within GRUB, that just fire up submenus. This is disabled.
The output is written through to the console. Here, we're looking
at the default entries that are written through to each Linux
entry each time we load a Linux kernel.
These are all options.
We'll talk more about these later.
The entry here, disabling the recovery equals true, so we don't add a
recovery entry in for each kernel that we put in, only the current
kernel. And with later versions of GRUB 2,
we use the bootloader specifications, so BLSCFG=true is the boot
loader specification configuration being set to true. Now I think
it's about time we left these slides,
walked into our command line, and started learning a
little bit more about GRUB defaults,
changing our timeout, and updating the GRUB configuration. And here
we are, then on our glorious Alma Linux 8 system. We're gaining our
root privileges and taking a look inside of our etc/default
subdirectory and our GRUB file.
This is then the default settings for GRUB.
We're going to concentrate to begin with on the timeout. Now
we've seen from the default that it's set to 5, and our menu
is displayed for 5 seconds.
Very often working with servers,
we're never going to see that menu, so we don't
particularly need it for a longer time.
But if we were working on a desktop system, we might want it,
say for an example, of 10 seconds.
If I edit the file and change that to 10 seconds, then we're able
to get a longer interaction with our menu. But just changing the
configuration file doesn't do a lot.
We need to make a new configuration out of this,
which we do with the grub2‑mkconfig command. The output of this command
we make sure that we write to the etc/grub2.cfg file.
So this is then building a new configuration using those default settings,
and, of course, now we will have updated our timeout to 10 seconds. Now
moving on to our second setting, the GRUB_DISTRIBUTOR, this information is
extracted from our system‑release file.
When we take a look at this,
we've got AlmaLinux space of release space 8.5 Arctic Sphynx.
The sed command is going through and substituting the space release and
any other characters after that with an empty string, so it's only
returning AlmaLinux. But if we look at it in a more normal sed format
where we're using our forward slash as our delimiter rather than the
comma, it might read a little bit more easily if you've seen any sed
statements before.
So as we go through and put then our replacement string of
being then the empty two forward slashes,
we can see then that we're extracting just the AlmaLinux.
Everything else has been replaced with an empty string.
So the AlmaLinux then just becomes prefixes to our menu items.
But to see this now, we can go through and reboot our system and
just take a look at our new timeout.
So I do a sudo power off. And again,
I'm going to switch back just to look at the raw VirtualBox
system, and we can see now that we've got our AlmaLinux entries, and we've got our 10‑second display.