Description: Candidates should be able to guide the system through the booting process.
Key Knowledge Areas:
- Provide common commands to the boot loader and options to the kernel at boot time
- Demonstrate knowledge of the boot sequence from BIOS to boot completion
- Understanding of SysVinit and systemd
- Awareness of Upstart
- Check boot events in the log files
Terms and Utilities:
The Linux Boot Process
- Power on
- Processor loads firmware(BIOS/EFI) that is stored in a EEPROM chip in the motherboard
- BIOS/EFI initializes the POST (Power-On Self Test) to check hardware resource
- BIOS/EFI searches and loads the 1st stage boot loader, located in the MBR or in the EFI partition of the first available disk, and gives control to it
MBR initiates the Boot loader(GRUB or LILO)
Instead of relying on code stored in boot sectors on the hard disk, EFI relies on boot loaders stored as files in a disk partition, known as the EFI System Partition (ESP), which uses the File Allocation Table (FAT) filesystem.
Boot loaders reside in files with .efi filename extensions stored in sub-directories named after the OS or boot loader name under the EFI sub-directory of the ESP. Thus, you might have a boot loader called /boot/efi/EFI/ubuntu/grub.efi or /boot/efi/EFI/suse/elilo.efi. This configuration enables you to store a separate boot loader for each OS you install on the computer.
- GRUB or LILO loads the kernel module
- Kernel module find /sbin/init and executes it
- Init read /etc/inittab then decides the run level
- Init finds partition table information from /etc/fstab file and mounts partitions accordingly
- Init then launches all the services/scripts specified in the /etc/init.d directory of the default run level.
Systemd Based (find in systemd part)
Usually the boot loader installed to one of two places: MBR(the first sector on hard drive) or boot sector(the first sector of one of the Linux partitions).
Common Commands at Boot Time
Parameters typed on the boot options prompt are passed directly to the Kernel upon initialization.
Some common Linux boot options:
Set the framebuffer’s resolution. Such as
vga=7922 (this does not affect the definition in Xorg).
Turn off APM (Advanced Power Management) for compatibility reason by setting
Set system reboot time after a panic occur by using
Enter troubleshooting(single user) mode by adding
rowill mount root filesystem in read-only mode so that the
fsckcan be used to check root filesystem errors.
systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic.
systemd based boot process
Logging Boot Events
dmesgcommand still available
jalo@myhost:~$ journalctl --list-boots 0 28c00d01142c4ccaa8c14bd1b5488c12 Thu 2016-10-27 15:11:31 CST—Thu 2016-10-27 15:12:03 CST
0 is the reference ID for latest boot of the system 28c00d01142c4ccaa8c14bd1b5488c12 is the actual boot id
To view the previous system boot log, you would use the command: