Introduction to GRUB


GRUB stands for GRand Unified Bootloader.

GNU GRUB is capable of loading a variety of free and proprietary operating systems. GRUB will work well with Linux, DOS, Windows, or BSD.

GRUB is dynamically configurable. This means that the user can make changes during the boot time, which include  altering existing boot entries, adding new, custom entries, selecting different kernels, or modifying initrd. GRUB also supports Logical Block Address mode. This means that if your computer has a fairly modern BIOS that can access more than 8GB (first 1024 cylinders) of hard disk space, GRUB will automatically be able to access all of it.

GRUB can be run from or be installed to any device (floppy disk, hard disk, CD-ROM, USB drive, network drive)  and can load operating systems from just as many locations, including network drives. It can also decompress        operating system images before booting them.

You can learn much, much more from the official GNU GRUB Manual 0.97.

What is LILO?

You may have heard about another Linux bootloader called LILO (stands for LInux  LOader).  Option for GRUB but, I think that GRUB is a better choice,

because:

  • LILO supports only up to 16 different boot selections; GRUB supports an unlimited number of boot entries.
  • LILO cannot boot from network; GRUB can.
  • LILO must be written again every time you change the configuration file; GRUB does not.
  • LILO does not have an interactive command interface.

After reading this, You will definetely go for GRUB

How does GRUB work?

When a computer boots, the BIOS transfers control to the first boot device, which can be a hard disk, a Flashdrive (Pen-drive), a CD-ROM, or any other BIOS-recognized device.

Lets Consider hard disks,

The first sector on a hard is called the Master Boot Record (MBR). This sector is  only 512 bytes long and contains a small piece of code (446 bytes) called the primary boot loader and the  partition table (64 bytes) describing the primary and extended partitions.

By default, MBR code looks for the partition marked as active and once such a partition is found, it loads its        boot sector into memory and passes control to it.

GRUB replaces the default MBR with its own code.

And GRUB Works in following stages:

Stage 1 is located in the MBR and mainly points to Stage        2, since the MBR is too small to contain all of the needed data.

Stage 1.5 also exists and might be used if the boot information is small enough  to fit in the area immediately after MBR.

Stage 2 points to its configuration file, which contains all of the complex user   interface and options we are normally familiar with when talking about GRUB. Stage 2 can be located anywhere on   the disk. If Stage 2 cannot find its configuration table, GRUB will cease the boot sequence and present the   user with a command line for manual configuration.

Advertisements

5 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s