Linux Boot Sequence
Linux Boot Sequence
BIOS
Master Boot Record (MBR)
LILO or GRUB
Kernel
Init
Run Level’s
BIOS
Floppy
CDROM
Hard Drive
The boot order can be changed from within the BIOS. BIOS setup can be entered by
pressing a key during boot up. The exact key depends varies, but is often one
of Del, F1, F2, or F10.
BIOS loads and execute the first 512 bytes off the disk (/dev/sda)
Standard DOS MBR will:
o look for a primary partition (/dev/sda1-4) marked bootable
o load and execute first 512 bytes of this partition
LILO
Loading sequence:
Reconfiguring LILO
image=/bzImage-2.4.14
label=14
read-only
run /sbin/lilo
reboot to test
GRUB
Kernel
initialize devices
(optionally loads initrd)
mounts root filesystem
o specified by lilo or loadin with root= parameter
o kernel prints: VFS: Mounted root (ext2 filesystem) readonly.
runs /sbin/init which is process number 1 (PID=1)
initrd
/sbin/init
reads /etc/inittab (see man inittab which specifies the scripts below
o Run boot scripts:
redhat: /etc/rc.d/rc.sysinit script which: loads modules, check root
FS and mount RW, mount local FS, setup network, and mount
remote FS
o switches to default runlevel eg 3.
run programs specified in /etc/inittab
Run Levels
0 halt
1 single user
2-4 user defined
5 X11 only
6 Reboot
Default is defined in /etc/inittab, eg:
o id:3:initdefault:
The current runlevel can be changed by running /sbin/telinit # where # is the new
runlevel, eg typing telinit 6 will reboot.