37. System Startup And Shutdown Flashcards

1
Q

Learning Objectives

By the end of this chapter, you should be able to:

A
  • Explain the boot process.
  • Identify several types of boot loaders.
  • Describe what the BIOS does.
  • Identify the relevant configuration files.
  • Describe how the system shuts down and reboots.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Boot Sequence

What is the basic steps in the boot sequence?

A
  • The BIOS/UEFI locates and executes the boot program, or boot loader.
  • The boot loader loads the kernel.
  • The kernel starts the init process (pid=1).
  • init manages system initialization, using systemd or the older Upstart and SysVinit startup scripts.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Boot Sequence

First, the BIOS runs the POST (Power On Self Test), which checks the ___ and ___ and then searches a specific location or device for a ___ program. Typically, the ___ program is found in the device’s MBR (Master Boot Record, or using UEFI). Control of the computer is then transferred to this ___ program (usually GRUB).

The ___ program then loads the kernel into the memory and executes it. On x86 platforms (and many others), the kernel first has to decompress itself in place. It then performs hardware checks, gains access to important peripheral hardware, and eventually runs the ___ process.

The ___ process in turn continues the system startup, running __ scripts if SysVinit is being used, or managing either Upstart or systemd.

Newer computers are moving to UEFI, a replacement for BIOS, which performs many of the same functions.

A
  • memory
  • hardware
  • boot, boot, boot, boot
  • init, init
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

BIOS

On the x86 architecture, the BIOS contains all the code required to gain initial access to the keyboard, display screen, disk drives, serial communications, and a number of miscellaneous functions. Once the full system is running, most of these devices will have enhanced capabilities when complete and specialized device drivers can be loaded and take over.

The BIOS is typically placed in a ROM chip that comes with the computer (it is often called a ROM BIOS). This ensures that the BIOS will always be available and will not be damaged by disk failures. This also makes it possible for a computer to boot itself.

During the boot process, the BIOS loads the boot loader.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Boot Loaders

Name 4 common linux bootloaders.

A
  1. GRUB
  2. efibootmgr
  3. LILO
  4. Das U-Boot
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Boot Loaders

Describe the GRUB bootloader

A

Virtually, all (non-embedded) modern Linux distributions use GRUB (GRand Unified Boot Loader). GRUB’s features include the ability to boot multiple operating systems, both a graphical and a text-based interface allowing ease of use over a serial cable, a powerful command line interface for interactive configuration, network-based diskless booting, and other advanced features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Boot Loaders

Describe the efibootmgr

A

efibootmgr is not actually a boot loader, but is a boot manager, used in conjunction with GRUB on multi-boot EFI systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Boot Loaders

Describe LILO boot loader

A
  • The Linux Loader (LILO) is old and obsolete.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Boot Loaders

Describe Das U-Boot boot loader

A

Das U-Boot is in wide usage for embedded systems. There are some other boot loaders used, including bareboot. However, we are not focused on embedded systems in the present course.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Configuration Files in /etc

Earlier, we discussed about where Linux distributions cooperate, and hopefully follow agreed-upon standards to place certain kinds of files in standard places on the system.

In particular, system-wide configuration files are generally placed in /etc and its subdirectories, while user-specific ones are often placed in their individual home directories. This is not completely true; for example, default configuration information might be stored in /usr/lib/systemd, but can be overridden by files in /etc/systemd.

For historical reasons, Linux distributions evolved their own rules about exactly where to place some information in /etc. For example, all Red Hat-derived systems make extensive use of /etc/sysconfig, while Debian-based systems have used /etc/default. Interestingly, RHEL and SUSE use both.​

There should be only text files found under /etc, no binary formats or data.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

/etc/sysconfig

Files in this directory and its subdirectories are used by many system utilities services. They are often consulted or invoked when the system starts and stops services or queries their status.

On RHEL systems:

$ ls /etc/sysconfig

We can take a look at one file in the screenshot here; this file reads and sets the selinux configuration at system startup.

$ cat /etc/sysconfig/selinux

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

/etc/default

The screenshot shows the /etc/default directory on an Ubuntu system.

The use of this directory is similar to that of Red Hat’s /etc/sysconfig:

  • The files are used to provide extra options when starting a service.
  • They typically contain code to set environment variables.

For example, the file /etc/default/useradd sets the defaults that are used when new user accounts are being created. All significant Linux distributions, including Red Hat-based ones, now have /etc/default, even if they still have /etc/sysconfig.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Shutting Down and Rebooting

Shutdown is used to bring the system down in a secure fashion, notifying all users that the system is going down and then stopping it in a graceful and non-destructive way. After it is shut down, the system is either halted or rebooted. You can see some shutdown examples here:

$ shutdown -h +1 “Power Failure imminent”
$ shutdown -h now
$ shutdown -r now
$ shutdown now

The options can easily be listed by the built-in –help message.

With no options (e.g. shutdown now), the default behavior is to power off the system completely. Some distributions, such as Ubuntu, violate this and go to single user mode instead.

There are also the legacy commands reboot, halt, and poweroff, which many veteran users use frequently.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly