Chapter 5 Flashcards
Explaining the Boot Process
Describe the Linux boot process.
- The BIOS or UEFI starts a bootloader program from the Master Boot Record, which is usually the Linux GRUB Legacy or GRUB2 program.
- The bootloader program loads the Linux kernel into memory, which in turn looks for the init program to run.
- The init program starts individual application programs and starts either the command-line terminals or the graphical desktop manager.
Describe the Linux GRUB Legacy and GRUB2 bootloaders.
- The GRUB Legacy bootloader stores files in the
/boot/grub
folder and uses themenu.lst
orgrub.conf
configuration file to define commands used at boot time. - The commands can create a boot menu, allowing you to select between multiple boot locations, options, or features.
- You must use the
grub-install
program to install the GRUB Legacy bootloader program into the Master Boot Record. - The GRUB2 bootloader also stores files in the
/boot/grub
folder, but it uses thegrub.cfg
configuration file to define the menu commands. - You don’t edit the
grub.cfg
file directly but instead store files in the/etc/default/grub
file or individual configuration files in the/etc/grub.d
folder. - Run the
grub-mkconfig
program to generate the GRUB2 configuration from the configuration files and then redirect the output to the/etc/grub.cfg
file.
Describe alternative Linux bootloaders.
- The LILO bootloader is used on older Linux systems. It uses the
/etc/lilo.conf
configuration file to define the boot options. - The Syslinux project has created the most popular alternative Linux bootloaders. The SYSLINUX bootloader provides a bootloader that runs on FAT filesystems, such as floppy disks and USB memory sticks.
- The ISOLINUX bootloader is popular on LiveCD distributions, as it can boot from a CD or DVD. It stores the bootloader program in the
isolinux.bin
file and configuration settings in theisolinux.cfg
file. - The PXELINUX bootloader program allows a network workstation to boot from a network server. The server must contain the
pxelinux.0
image file along with thepxelinux.cfg
directory, which contains separate configuration files for each workstation. - The EXTLINUX bootloader is a small bootloader program that can be used on smaller embedded Linux systems.
Describe how to recover from a kernel panic.
- The GRUB bootloaders provide you with options that can help if your Linux system fails to boot or stops due to a kernel panic issue. You can press the E key at the GRUB boot menu to edit any boot menu entry, then add any additional kernel parameters, such as placing the system in single-user mode.
- You can also use a rescue disk to boot Linux into memory, then use the fsck command to repair any corrupted hard drives, and finally use the mount command to mount them to examine the files.
What program does the workstation firmware start at boot time?
A bootloader The fsck program The Windows OS The mount command The mkinitrd program
A. The workstation firmware looks for the bootloader program to load an operating system. The fsck program (option B) is used to check and repair damage to hard drives, so it isn’t useful until after the Linux system has started. The Windows operating system only starts after a Windows bootloader program can run, so option C is incorrect. The mount program is a Linux tool for attaching a partition to the virtual directory, which isn’t available until after the Linux system starts, so option D is also incorrect. The mkinitrd program is used to create an initrd RAM disk used for booting, but it isn’t run when the workstation starts up, so option E is incorrect.
Where does the firmware first look for a Linux bootloader program?
The /boot/grub folder The Master Boot Record (MBR) The /var/log folder A boot partition The /etc folder
B. The workstation firmware looks at the first sector of the first hard drive to load the bootloader program. This is called the Master Boot Record, so option A is correct. The bootloader program itself can use the chainloader feature to look for another bootloader in a boot partition, but the firmware can’t do that, so option D is incorrect. Option A specifies the configuration folder used to store the GRUB configuration file and the kernel image file, but the actual GRUB bootloader program can’t be stored there. Option C specifies the common log file folder, but that doesn’t contain the GRUB bootloader program. Option E also specifies a common Linux configuration file directory, but it’s not used to store the GRUB bootloader program that the firmware can access.
The ______ command allows us to examine the most recent boot messages.
fsck init mount dmesg mkinitrd
D. The kernel ring buffer, which you can view by typing dmesg, contains messages from the boot messages from the kernel; thus, option D is correct. The fsck program (option A) fixes corrupted partitions, and the mount program (option C) is used to attach partitions to the virtual directory, so neither of those is correct. Option B, the init program, is used to start programs from the kernel, not display boot messages, so it also is incorrect. Option E, the mkinitrd program, is used to create a new initrd RAM disk and is not related to the boot messages, so it too is incorrect.
What folder do most Linux distributions use to store boot logs?
/etc /var/messages /var/log /boot /proc
C. Most Linux distributions store boot log files in the /var/log folder. The /etc folder is most often used for storing system and application configuration files, not boot logs, so option A is incorrect. Some Unix systems use the /var/messages folder for storing log files, but Linux has not adopted this standard, so option B is also incorrect. The /boot folder contains the GRUB configuration files along with the image files necessary to boot the system, but it’s not where Linux stores boot logs and is thus incorrect. The /proc folder is unique in that the Linux kernel dynamically stores information about the system there, but it doesn’t store boot log information there.
Where does the workstation BIOS attempt to find a bootloader program? (Choose all that apply.)
An internal hard drive An external hard drive A DVD drive A USB memory stick A network server
A, B, C, D, E. The BIOS firmware can look in multiple locations for a bootloader program. Most commonly it looks at the internal hard drive installed on the system; however, if none is found, it can search other places. Most workstations allow you to boot from an external hard drive or from a DVD drive. Modern workstations now also provide the option to boot from a USB memory stick inserted into a USB port on the workstation. Finally, many workstations provide the PXE boot option, which allows the workstation to boot remotely from a network server.
Where is the Master Boot Record located? (Choose all that apply.)
The first sector of the first hard drive on the system The boot partition of any hard drive on the system The last sector of the first hard drive on the system Any sector on any hard drive on the system The first sector of the second hard drive on the system
A. The Master Boot Record (MBR) is only located in one place: on the first sector of the first hard drive on the workstation; thus, option A is the only correct answer. The boot partition in any hard drive may contain a bootloader, but it is not the Master Boot Record, which is run first by the firmware; thus, option B is incorrect. The other locations are not valid locations for the Master Boot Record, so options C, D, and E are all incorrect.
The EFI System Partition (ESP) is stored in the _______ directory on Linux systems.
/boot /etc /var /boot/efi /boot/grub
D. The ESP is stored in the /boot/efi directory on Linux systems. The UEFI firmware always looks for the /boot/efi directory for bootloader programs, so option D is correct. The /etc directory is used to store application and system configuration files, not bootloader programs, so option B is incorrect. The /var folder is used to store variable files such as log files, not bootable files, so option C is incorrect. Option E, the /boot/grub file, is used in GRUB Legacy and GRUB2 to store the bootloader configuration files, as well as the kernel image files. However, it is not used to store the bootloader files themselves, so option E is incorrect.
What file extension do UEFI bootloader files use?
.cfg .uefi .lst .conf .efi
E. The UEFI specification doesn’t require a specific extension for UEFI bootloader files, but it has become somewhat common in Linux to use the .efi file extension to identify them; thus, option E is correct. Option A and option D specify file extensions used to identify GRUB2 (option A) and GRUB Legacy (option D) configuration files, not UEFI bootloader files, so they are both incorrect. Option C specifies the .lst file extension, which is also used for GRUB Legacy configuration files, so it too is incorrect. The .uefi file extension is not used in Linux, so option B is incorrect.
Which was the first bootloader program used in Linux?
GRUB Legacy LILO GRUB2 SYSLINUX ISOLINUX
B. The Linux Loader (LILO) bootloader program was the first bootloader used in Linux, so option B is correct. The GRUB Legacy bootloader, despite its name, wasn’t the first bootloader, but the second bootloader commonly used in Linux. The GRUB2 bootloader was a later improvement over the GRUB Legacy bootloader, so options A and C are incorrect. Option D, the SYSLINUX bootloader, provides features for use with Microsoft FAT partitions, so that you can boot Linux from a floppy drive or USB memory stick, but it is a later creation and not the first Linux bootloader. Option E, ISOLINUX, is also a later bootloader that allows us to boot Linux from a CD or DVD drive.
Where are the GRUB Legacy configuration files stored?
/boot/grub /boot/efi /etc /var /proc
A. The GRUB Legacy configuration files are stored in the /boot/grub directory, so option A is correct. Option B, the /boot/efi directory, is used to store UEFI bootloader programs, not GRUB configuration files, so it is incorrect. Option C, the /etc directory, stores many application and system configuration files, but not the GRUB Legacy configuration files. The /var directory stores variable files such as log files but not configuration files, so option D is incorrect. Likewise, Linux uses the /proc directory to provide dynamic kernel runtime data and not configuration files.
Where are GRUB2 configuration files stored? (Choose all that apply.)
/proc /etc/grub.d /boot/grub /boot/efi /var
B, C. The GRUB2 bootloader stores configuration files in both the /boot/grub directory and the /etc/grub.d directory, so options B and C are correct. Linux uses the /proc directory to provide dynamic kernel runtime data and not configuration files, so option A is incorrect. Option D, /boot/efi, stores UEFI bootloader program files, not GRUB2 configuration files, so it is also incorrect. Option E, /var, is used to store variable files, such as log files, and not configuration files, so it is incorrect.