DEPARTMENT OF COMPUTING

The Linux Boot Sequence

How does your kernel get loaded, what is the series of steps that occurs in order to make this happen, what partition to choose? These will be discussed in these slides.


The BIOS

BIOS stands for Basic Input Output System. This is the first system involved in the boot process. BIOS is stored in read-only memory (on a chip)(PROM)

The bios:


Master Boot Record

This is step 2 of the load sequence. The MBR is located on the first sector of the boot device.

On most linux devices the MBR would contain (or contain a reference to) the GRUB boot loader. If booting from something other than a hard disk, you might use a different bootloader, but they essentially all do the same thing.

We know that MBR also has partition table information.


The bootloader (GRUB)


The kernel

[The kernel] initializes the devices (via their drivers), starts the swapper (it is a “kernel process”, called kswapd in modern Linux kernels), and mounts the root filesystem (/).(from man page)

Kernel then executes the /sbin/init program. (PID 1)

initrd (initial ram disk) is a temporary root fs used by kernel, until the real fs is mounted. Also has drivers in it.


Init

This program first looks at /etc/inittab file to decide linux run level. Sometimes it is also referred to as sysvinit. (System 5 Init)

Following are the available run levels

0 – halt
1 – Single user mode
2 – Multiuser, without NFS
3 – Full multiuser mode
4 – unused
5 – X11
6 – reboot

taken from here


More about Init


Upstart

To see how an event-driven system can improve on traditional init scripts, let’s take the previous example of a system booted with an unplugged network cable. You could create an Upstart script that is triggered when a network cable is plugged in. That script could then restart the networking service for you. You could then configure any services that require a network connection to be triggered whenever the networking service starts successfully. Now when the system boots, you could just plug in the network cable and Upstart scripts would take care of the rest. [From DevOps Troubleshooting]


More Upstart


Last Updated 12/15/2017