Getting grubby: Demystifying the Linux start-up processes
The BIOS and the boot loader
No matter what operating system is installed, when a computer is powered up control is first given to the motherboard’s built-in BIOS. The BIOS performs a power-on self test (POST) which assesses if attached devices are functioning normally.
If all is well, the BIOS hands over control to the master boot record (MBR) of the boot device. Different media may be used for booting – like CD/DVD ROMs and USB drives – but most commonly a computer will boot from an internal hard drive.
Linux distros offer several different boot loaders; LILO was once popular, and others now exist which may vary by vendor; Red Hat have implemented GRUB as their only boot loader for example while others use syslinux. IBM offer a comparison between LILO and GRUB, but the significant thing to know is that each Linux variant requires, and offers, a boot loader whatever it may be.
Older PCs need the boot loader to be located within the first 1024 cylinders of the hard disk and necessitates the /boot partition to be in a primary partition. Modern BIOSs support logical block addressing (LBA) which avoids this restriction by letting the BIOS work with much more of the hard drive.
GRUB derives its name from its objective as “The Grand Unified Bootloader”, seeking to serve all your operating system booting needs. GRUB – and any boot loader – is partially stored within the MBR itself. It will list the different operating systems available for booting on your computer – of which there may be just one, or there may be many. Either way, the primary purpose of GRUB is to determine which OS to boot and to then, in daisy chain fashion, pass control on to it.
For Linux operating systems, GRUB will specify the disk partition that should become the root partition, the location of the kernel and the initial RAM disk. These may be listed in /boot/grub/grub.conf like so:
title Red Hat Enterprise Linux
kernel /vmlinuz.EL ro root=LABEL=/ rhgb quiet
(Other boot loaders will have a similar config file.)
These settings specify this operating system should be displayed in GRUB’s list as “Red Hat Enterprise Linux.” Its /boot directory is located on the fifth partition on the first hard drive (these indexes are 0-based, hence the “4” actually means the fifth partition.)
The kernel is the file vmlinuz.EL which is located within the /boot directory. This is opened as read-only (mode “ro”) to protect from any accidental harm. The actual top-level root directory is associated with the / label, and finally rhgb quiet directs boot messages to be hidden by default. Other directives can be specified here; selinux=0 for instance will disable Security Enhance Linux (SELinux).
RECRUITMENT & RETENTION REPORT 2013HIRE OR FIRE? BUY OR BUILD
2013 is well underway and Australian companies need to know whether they should invest in IT skills training or pay a premium for the people they need.
If you want to know which choices are being made in your sector, what skills are hard to find, which sectors intend to hire or fire and where the IT spend is going, this free report is must have.
David has been computing since 1984 where he instantly gravitated to the family Commodore 64. He completed a Bachelor of Computer Science degree from 1990 to 1992, commencing full-time employment as a systems analyst at the end of that year. Within two years, he returned to his alma mater, the University of Newcastle, as a UNIX systems manager. This was a crucial time for UNIX at the University with the advent of the World-Wide-Web and the decline of VMS. David moved on to a brief stint in consulting, before returning to the University as IT Manager in 1998. In 2001, he joined an international software company as Asia-Pacific troubleshooter, specialising in AIX, HP/UX, Solaris and database systems. Settling down in Newcastle, David then found niche roles delivering hard-core tech to the recruitment industry and presently is the Chief Information Officer for a national resources company where he particularly specialises in mergers and acquisitions and enterprise applications.