ITS 2330 - Linux III

Chapter 1, Starting a System

Objectives:

This lesson introduces the student to concepts that are important to understanding what happens when a Linux system starts. Objectives important to this lesson:

  1. Customizing startup
  2. System recovery
  3. Alternate bootloaders
Concepts:

The chapter begins with the idea that there may be something wrong with your system, which gives us a reason to examine what should happen when the system starts.

  1. The boot process normally begins with a power on self test (POST) in which the hardware information stored in firmware (BIOS/UEFI) is compared to the components the computer can see. A beep code is issued and the system looks for a bootloader program in the locations listed as boot devices.
  2. Once the bootloader is found, it is run, and it locates the kernel of the installed Linux system.
  3. The kernel is loaded into RAM, and it calls processes to that produce messages for the user.

The text informs us that several messages produced by the boot process are only shown briefly, but they can be displayed again with the dmesg command, as shown on page 5. This command displays the messages stored in the kernel ring buffer. The messages stored here are overwritten each time the system boots. It is also possible to see boot messages in log files,

  • Debian based systems often store log files in /var/log/boot
  • Red Hat based systems, often use /var/log/boot.log.

The author spends a little space on the difference between BIOS and UEFI systems, and reminds us that some Linux distros do not support UEFI hardware. In my opinion, this is a good argument for selecting a distro that does support it, since BIOS hardware is becoming rare.

You will need to know that the three bootloaders you are likely to encounter are LILO, GRUB, and GRUB2. They are all bootloader programs, but each is has more features than the previous model.

  • LILO - Linux Loader, used in the 1990s, configuration file is /etc/lilo.conf; does not work with UEFI hardware
  • GRUB (Legacy) - Grand Unified Bootloader, created in 1999 to support UEFI; configuration file is /boot/grub/menu.lst
  • GRUB2 - created in 2005, presents more options and recognizes external drives; global configuration file is /boot/grub/grub.cfg and separate boot files are stored in /etc/grub.d, one for each boot option

The next section of the text is about using GRUB, both GRUB Legacy and GRUB2. Installation and configuration are different, so we can assume that they will be different for each of the alternative bootloaders listed on page 14. Each addresses a different hardware configuration that has a limited audience.

The video below discusses these concepts and adds a few details.


Assuming your system has loaded a kernel, it needs to load a shell, which happens in the initialization sequence. The text says that the system will look for the init file in three places:

  • /sbin/init
  • /etc/init
  • /bin/init

If the init file is not found, the system will try to start /bin/sh, which is a default shell. The value of the init program is that it can start several other programs that the administrator has decided the computer needs to run on boot. It can call all of the batch files to start them simultaneously. If the default shell starts, that means that init did not run, and the admin has to start the programs manually. The init program is one of three versions that the text mentions:

  • Unix System V (also called SysV) - uses seven runlevels (0-6) to determine which set of processes to run (see list on page 17); note that most distros will use 3 (Red Hat, Mulituser, text interface), 5 (Red Hat, Multiuser, graphical interface), or 2 (Debian, Multiuser, graphical interface)


  • systemd - developed by Red Hat to replace SysV; uses targets and units to determine which processes run at start; the following video discusses how systemd worked in 2015 (note that this bullet should have come third the list)



  • Upstart - developed by Ubuntu; allows processes to run for hot-pluggable devices; the video below is from 2012, further illustrating that the author is correct, but she has encountered a time warp


The text discusses these three possible management approaches through page 27.

Okay, Can't help it. That last video was on Suse Linux. Surely, you know her sister?



The text continues with a discussion of system recovery. Read through this short section and the exercise that follows it.