101.2 Boot The System

  • Provide common commands to the boot loader and options to the kernel at boot time
  • Demonstrate knowledge of the boot sequence form BIOS to boot completion
  • Understanding of SysVinit and system
  • Awareness of Upstart
  • Check boot events in the log file
  • The following is a partial list of the used files, terms and utilities:
    • dmesg
    • BIOS
    • bootloader
    • kernel
    • initramfs
    • init
    • SysVinit
    • system

Common Boot loader commands and options to the kernel at boot time

  • GRUB configuration
    • View and select from all available kernels
    • Multi-boot support
    • /etc/default/grub
    • grub2 -mkconfig -o  /boot/grub2/grub.cfg
      • Generates new GRUB 2 config
      • Updates config file
  • CentOS installation
    • Verify BIOS settings
    • Hardware Compatibility
  • Boot Parameters
    • Interactive or persistent commands
    • cat /proc/cmdline
    • Minimal parameters
      • root=
      • ro
  • Kernel Parameters
    • quiet (suppress all non-critical kernel messages)
    • log buf len (kernel log buffer size – used by dmesg)
    • modprobe (view and configure kernel modules)
    • crashkernel (save copy of memory for debugging use)
  • Ramdisk parameters
    • Loaded into memory by GRUB
    • Initial ramdisk runs /sbin/init script to read boot parameters
    • rdinitdebug (causes init script to print each line during execution)
  • Mounting root filesystem (/) during boot
    • May require filesystem module
    • May require hardware drivers
      • HW RAID
      • SAN HBA
      • SCSI

Demonstrate knowledge of the boot sequence from BIOS to boot completion

  • System BIOS Tasks
    • Power-On Self Test (POST)
    • Initial hardware setup and configuration
    • Hardware adapter initialized
      • (SCSI, SAN HBA, RAID)
  • First stage GRUB is loaded from MBR
    • Stage 1.5 GRUB provides filesystem drivers
    • Stage 2 GRUB is loaded
  • Second stage GRUB
    • Reads config file or displays the GRUB command prompt
    • Initial Ramdisk is loaded
    • Linux kernel is loaded from hard drive and decompressed
    • Kernel is executed with command line arguments
  • Linux Kernel
    • Hardware is initialized and configured using drivers in kernel
    • initramfs is decompressed and mounted
    • init script runs from initramfs
    • init script loads kernel modules and mounts root filesystem
    • Executes /sbin/init from the mounted root filesystem

Awareness of upstart

  • Upstart is an event-based replacement for the init daemon
  • It is asynchronous and compatible with sysvinit
  • Configuration files
    • /etc/inittab
    • /etc/init/*

Check boot events in the log file

  • Boot events can be found in several locations
    • /var/log/boot.log
    • /var/log/messages
    • /var/log/dmesg
  • Errors are usually more interesting than successful events…

Leave a comment