You are on page 1of 12

Welcome to the Oracle Linux Advocate Accreditation module covering Grub.

Grand Unified Boot Loader, or GRUB is software that prepares the hardware for the OS boot after the server hardware
has been initialized, and then starts the OS boot loader. GRUB does additional hardware initialization in preparation for
the operating system boot, and it is able to control what the OS boots from, such as a different hard disk. GRUB is open
source software and can be changed for the needs of each operating system. Oracle made changes to GRUB for the
Oracle Linux distribution.
Grub is installed when the Oracle Linux operating system is installed. GRUB is located in the folder /boot/grub. If boot
changes need to be made, the grub.conf file should be edited carefully. Be sure to use caution if this file needs to be
changed as errors could result in a non-bootable system. An example of when you would need to make changes to this
file might be if you installed a new kernel update and you want to permanently revert back to the previous version.

Notice there is also a menu.lst file, which is used by grub in other operating systems such as Solaris. In Oracle Linux, the
menu.lst file links to the grub.conf file.
This is an example of a grub.conf file. We see that this system is running Oracle Linux version 6 by looking at the kernel
version.
This example grub.conf file has two boot options defined. Each boot option starts with the word “title” and includes the
lines that begin with “root” and “kernel.” (highlight lines in video) The default line determines the default boot option
for the system. Default=0 indicates that the first line in the file that starts with the word “title” will be used as the
default boot option. If default is changed to default=1, the second line starting with the word “title” will be used as the
default boot option. If additional boot options were available, the default number options would increase incrementally.
So if there was a third boot option, to set the default boot to the third option, you would set the default line equal to
the number 2.
Instead of changing the default boot option in the grub.conf file, you can choose to use different a boot option during
the boot process. At boot up, you can boot using a different kernel by pressing up or down arrows to highlight the kernel
with which you want the system to boot.
Next we’ll look at booting to single user mode. There are several steps required to boot to Single User Mode.
First you need to pause Grub from automatically booting by pressing the spacebar when you see the Grub
menu screen. Next, highlight the kernel line you wish to edit and press “e” to enter edit mode.
Then highlight the kernel link and press “e” again.
In Oracle Linux 6, the way to enter single user mode is to add an “s” or the word “single” to the end of the kernel line
and press Enter/Return. And finally press “b” to boot the edited line. In Oracle Linux 7, you would add
“systemd.unit=rescue.target” to the end of the kernel line.
To boot to single user mode which is called “rescue shell” in Oracle Linux 7, you would add “systemd.unit=rescue.target”
to the end of the kernel line. Then press Ctrl-x to start the system.
The system will then boot to Single User Mode.
And finally, at the end of the boot process, this is an example showing when the system boots to the login prompt.

You might also like