GRUB stands for Grand Unified Bootloader and was created in 1995 by Erich Boleyn as he wanted to have a multiboot option . Intel based motherboards must be started with a 16-bit operating system because of a limitation to 640 kilobytes of RAM at startup. GRUB is used to facilitate the 16-bit requirement and load the 32-bit Linux kernel. The AMD CMOS is 64-bit so it can load the 64-bit kernel for Linux. In order for GRUB to work it must use a three step process on CentOS. The first step loads and executes the Master Boot record, this is the IPL or initial program loader for GRUB. The first stage of GRUB also starts stage1.5 which is able to understand the filesystem and acts as a bridge to stage2. Then stage1.5 will start stage2 which reads the file in /boot/grub/grub.conf and starts the kernel.
This course provide a basic understanding of GRUB and give you some illustrations on how to secure it and to fix several common problems.
The course level is for an Experienced Linux Administrator. Please note that any changes you make to GRUB could lead to a system that does not boot if you make a mistake so learn on a test system.
GRUB Error Messages
Fix GRUB Config
The course author, among others, will be available for questions in the Forum.
Start The Course
Here is a summary of the boot process and where GRUB is positioned. If you are looking for a Live CentOS Server Course CLICK HERE.
–Select boot Device
–Load and execute MBR
–Load/execute first stage of GRUB
–Load/execute stage1.5 of GRUB
–Load/execute second stage of GRUB
–Mount Initial RAM disks
–Mount root System
–run the rc command
–run rc?.d/K* stop
–run rc?.d/S* start
–text based logins
GRUB is a boot loader, which is the first piece of software that runs when the server starts. GRUB loads and transfers control to the operating system, specifically the kernel. GRUB is flexible enough to understand different filesystems and kernel executable formats.
GRUB has a fistful of options, including the most important to be able multiboot. In the design, the primary goals beyond multiboot were easy to use aspect for users, generous functionality to support both the experts and designer and backward compatibility. The other features which exist are multiple executable formats, support for non-multiboot kernels, ability to load multiple modules, ability to load a configuration file, create a menu interface, flexible command line, support for multiple filesystem types, automatic decompression using gzip, ability to access data on any installed device, independent of drive geometry translations, detect all the installed RAM, support for LBA mode, support for network booting and support for remote terminals. Yep, lots of features.
When you name devices with grub it must be placed within “( )”. So if you are naming a hard drive it would look like this:
“hd” is the hard drive, “0″ means that it is the first hard drive detected, and “0″ is the first partition on the hard drive. Note, that if you were using the /boot partition for grub, which is typical, the Linux file system lists this drive differently.
/dev/sda1 = (hd0,0)
Grub always lists drives and partitions from “0″ while the Linux file system lists them from “1″. The other item of note is that GRUB only uses the “hd” convention, in other words it does not distinguish IDE, SATA or SCSI. GRUB only counts the drive numbers starting with zero.
Here is an example output from df, note the /boot directory is hda1 or according to GRUB, (hd0,0) because it is the first drive, first partition.