Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Boot Process : BIOS -> MBR ->Grub -> Kernel -> Init (the first process, /etc/inittab ->

starts
/etc/rc.sysinit and /etc/rcX
The following are the 6 high level stages of a typical Linux boot process.
1. BIOS
BIOS stands for Basic InputOutput Syste!
"erfor!s so!e syste! integrity chec#s
Searches$ loads$ and executes the boot loader progra!.
It loo#s for boot loader in floppy$ cd%ro!$ or hard drive. &ou can press a #ey 'typically
(1) of ()$ but it depends on your syste!* during the BIOS startup to change the boot
se+uence.
Once the boot loader progra! is detected and loaded into the !e!ory$ BIOS gives the
control to it.
So$ in si!ple ter!s BIOS loads and executes the ,B- boot loader.
). ,B-
,B- stands for ,aster Boot -ecord.
It is located in the 1st sector of the bootable dis#. Typically devhda$ or devsda
,B- is less than .1) bytes in si/e. This has three co!ponents 1* pri!ary boot loader
info in 1st 006 bytes )* partition table info in next 60 bytes 1* !br validation chec# in
last ) bytes.
It contains infor!ation about 2-3B 'or LILO in old syste!s*.
So$ in si!ple ter!s ,B- loads and executes the 2-3B boot loader.
1. 2-3B
2-3B stands for 2rand 3nified Bootloader.
If you have !ultiple #ernel i!ages installed on your syste!$ you can choose which one
to be executed.
2-3B displays a splash screen$ waits for few seconds$ if you don4t enter anything$ it
loads the default #ernel i!age as specified in the grub configuration file.
2-3B has the #nowledge of the filesyste! 'the older Linux loader LILO didn4t
understand filesyste!*.
2rub configuration file is bootgrubgrub.conf 'etcgrub.conf is a lin# to this*. The
following is sa!ple grub.conf of 5entOS.
6boot7devsda
default78
ti!eout7.
splashi!age7'hd8$8*bootgrubsplash.xp!.g/
hidden!enu
title 5entOS ').6.19%1:0.el.";<*
root 'hd8$8*
#ernel bootv!linu/%).6.19%1:0.el.";< ro root7L;B<L7
initrd bootinitrd%).6.19%1:0.el.";<.i!g
;s you notice fro! the above info$ it contains #ernel and initrd i!age.
So$ in si!ple ter!s 2-3B =ust loads and executes >ernel and initrd i!ages.
0. >ernel
,ounts the root file syste! as specified in the ?root7@ in grub.conf
>ernel executes the sbininit progra!
Since init was the 1st progra! to be executed by Linux >ernel$ it has the process id
'"IA* of 1. Ao a Bps %ef C grep init4 and chec# the pid.
initrd stands for Initial -;, Ais#.
initrd is used by #ernel as te!porary root file syste! until #ernel is booted and the real
root file syste! is !ounted. It also contains necessary drivers co!piled inside$ which
helps it to access the hard drive partitions$ and other hardware.
.. Init
Loo#s at the etcinittab file to decide the Linux run level.
(ollowing are the available run levels
8 D halt
1 D Single user !ode
) D ,ultiuser$ without E(S
1 D (ull !ultiuser !ode
0 D unused
. D F11
6 D reboot
Init identifies the default initlevel fro! etcinittab and uses that to load all appropriate
progra!.
<xecute Bgrep initdefault etcinittab4 on your syste! to identify the default run level
If you want to get into trouble$ you can set the default run level to 8 or 6. Since you
#now what 8 and 6 !eans$ probably you !ight not do that.
Typically you would set the default run level to either 1 or ..
6. -unlevel progra!s
Ghen the Linux syste! is booting up$ you !ight see various services getting started.
(or exa!ple$ it !ight say ?starting send!ail H. O>@. Those are the runlevel progra!s$
executed fro! the run level directory as defined by your run level.
Aepending on your default init level setting$ the syste! will execute the progra!s fro!
one of the following directories.
-un level 8 D etcrc.drc8.d
-un level 1 D etcrc.drc1.d
-un level ) D etcrc.drc).d
-un level 1 D etcrc.drc1.d
-un level 0 D etcrc.drc0.d
-un level . D etcrc.drc..d
-un level 6 D etcrc.drc6.d
"lease note that there are also sy!bolic lin#s available for these directory under etc
directly. So$ etcrc8.d is lin#ed to etcrc.drc8.d.
3nder the etcrc.drcI.d directories$ you would see progra!s that start with S and >.
"rogra!s starts with S are used during startup. S for startup.
"rogra!s starts with > are used during shutdown. > for #ill.
There are nu!bers right next to S and > in the progra! na!es. Those are the
se+uence nu!ber in which the progra!s should be started or #illed.
(or exa!ple$ S1)syslog is to start the syslog dea!on$ which has the se+uence nu!ber
of 1). S98send!ail is to start the send!ail dae!on$ which has the se+uence nu!ber of
98. So$ syslog progra! will be started before send!ail.
There you have it. That is what happens during the Linux boot process.
---------X------------
BIOS : Basic Input Output System when the pc power on the first process of the BIOS is
power-on-self-test (POST) , which initializes and identifies system deices (i!e "P#, $%&,
'ey(oard!!! etc ) and other )ardware !If errors occur, some form of alert will (e *enerated or
sent to a panel or console+ the POST uses a series of (eeps to indicate the specific error
encountered! The BIOS then identifies &B$,(oot loader that locate on peripheral deice
(desi*nated as a (oot deice ) such as )ard dis, or "-
MBR : Master Boot Record
The &aster Boot $ecord (&B$) is the first ./0 (ytes of the (oot drie that is read into memory
(y the BIOS! (This is assumin* we are usin* an 123 architecture!) The first 443 (ytes of that
./0 will normally contain a low-leel (oot code that points to a (oot loader somewhere else on
the dis, - it can een point to another hard dis,! The ne1t 34 (ytes contain the partition ta(le for
the dis, (four /3-(yte entries ,nown as the IB& Partition Ta(le Scheme)! 5inally, the remainin*
0 (ytes are the 6&a*ic 7um(er6 (used for error detection)!
Bootloader:The purpose of a (ootloader is to load the operatin* system! &any (oot loaders are
aaila(le+ howeer, 8I8O and 9$#B are the most common for 8inu1! :indows has its own,
called the 7ew Technolo*y 8oader (7T8-$).
The specifics of this process depend on the system architecture.
5or e1ample:
; BIOS-(ased 123 systems run a first-sta*e (oot loader from the &B$ of the primary hard dis,
that, in turn, loads an additional (oot loader, 9$#B!
; #<5I-(ased 123 systems mount an <5I System Partition that contains a ersion of the 9$#B
(oot loader! The <5I (oot mana*er loads and runs 9$#B as an <5I application!
; PO:<$ systems mount a PP" P$eP partition that contains the =a(oot (oot loader! The
System &ana*ement Serices (S&S) (oot mana*er loads and runs ya(oot!
; IB& System z runs the z>IP8 (oot loader from a -%S- or 5"P-connected deice that you
specify when you IP8 the partition that contains $ed )at <nterprise 8inu1
Grub: GRand Unified Bootloader is a (oot loader pac,a*e from the 97# Pro?ect ! 9$#B is the
reference implementation of the &ulti(oot Specification , which proides a user the choice to
(oot one of multiple operatin* systems installed on a computer or select a specific ,ernel
confi*uration aaila(le on a particular operatin* system@s partitions!
Kernel: :hen 9$#B transfers control to the ,ernel and the ,ernel is (ootin*, you may see a lot
of te1t output! On $ed )at-(ased systems, the line in *ru(!conf specifyin* the ,ernel may hae
an 6rh*( Auiet6 appended to it that preents this
:hat is actually *oin* on at this time is that the ,ernel is pro(in* your hardware and
confi*urin* itself for your hardware! The ,ernel is also loadin* modules in the initrd ima*e that it
needs to operate your hardware!Once the ,ernel is done with its initialization, it starts the
system@s first process, which is >s(in>init!
- -etect hardware
- load modules (>li(>modules)
- > filesystem read only
- init
Before the ,ernel is started a $%& dis, is initialized and used to load driers and modules
INIT:The init process runs /etc/rc.d/rc.sysinit, which starts networ, confi*uration, partitions
mounts, system cloc,, etc! The init process then finds which runleel it should (e searchin* at
the initdefault directie in /etc/inittab. Init starts out with a Process I- (PI-) of /
Run level ::hen you enter your runleel, you will see further Init messa*es (ein* printed to the
screen (dependin* if your machine is confi*ured to do so), a*ain endin* with a B O' C or B5ailedC
dependin* on whether it started successfully or not! These are your startup serices within your
runleels! :hen you loo, at your >etc>initta( file, you will see a line li,e 6id:.:initdefault:6+ this is
your default runleel! The default runleel on most serers will (e set to D+ on des,tops, of
course, it@s set to ., so we can hae an E :indow System session start as soon as the system
(oots up!
Frun leael
FGGsys init
FGGrcH!d
FGGrc!local
FGGirtual console
FGGE//
Login :That sums up the outline of the (oot process for a typical 8inu1 machine!
(oot loader! The specifics of this process depend on the system
architecture! 5or e1ample:
; BIOS-(ased 123 systems run a first-sta*e (oot loader from the &B$ of the primary hard dis,
that, in turn, loads an additional (oot loader, 9$#B!
; #<5I-(ased 123 systems mount an <5I System Partition that contains a ersion of the 9$#B
(oot loader! The <5I (oot mana*er loads and runs 9$#B as an <5I application!
; PO:<$ systems mount a PP" P$eP partition that contains the =a(oot (oot loader! The
System &ana*ement Serices (S&S) (oot mana*er loads and runs ya(oot!
; IB& System z runs the z>IP8 (oot loader from a -%S- or 5"P-connected deice that you
specify when you IP8 the partition that contains $ed )at <nterprise 8inu1

You might also like