Chapter 5 Flashcards

Explaining the Boot Process

1
Q

Describe the Linux boot process. 

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the Linux GRUB Legacy and GRUB2 bootloaders. 

A
  • The GRUB Legacy bootloader stores files in the /boot/grub folder and uses the menu.lst or grub.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 the grub.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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe alternative Linux bootloaders. 

A
  • 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 the isolinux.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 the pxelinux.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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe how to recover from a kernel panic. 

A
  1. 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.
  2. 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

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.

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

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
A

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.

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

The ______ command allows us to examine the most recent boot messages.

fsck
init
mount
dmesg
mkinitrd
A

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.

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

What folder do most Linux distributions use to store boot logs?

/etc
/var/messages
/var/log
/boot
/proc
A

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.

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

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

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.

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

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

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.

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

The EFI System Partition (ESP) is stored in the _______ directory on Linux systems.

/boot
/etc
/var
/boot/efi
/boot/grub
A

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.

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

What file extension do UEFI bootloader files use?

.cfg
.uefi
.lst
.conf
.efi
A

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.

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

Which was the first bootloader program used in Linux?

GRUB Legacy
LILO
GRUB2
SYSLINUX
ISOLINUX
A

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.

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

Where are the GRUB Legacy configuration files stored?

/boot/grub
/boot/efi
/etc
/var
/proc
A

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.

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

Where are GRUB2 configuration files stored? (Choose all that apply.)

/proc
/etc/grub.d
/boot/grub
/boot/efi
/var
A

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.

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

You must run the ______ command to generate the GRUB2 grub.cfg configuration file.

mkinitrd
mkinitramfs
grub-mkconfig
grub-install
fsck
A

C. The grub-mkconfig command combines the configurations defined in the /etc/default/grub file and all of the files in the /etc/grub.d folder into a single grub.cfg configuration file.

The mkinitrd command (option A) is used to create a new initrd RAM disk image file, so it is incorrect. Likewise, the mkinitramfs command (option B) is also used to create initrd image files on Debian systems, so it too is incorrect. The grub-install program is used by the GRUB Legacy bootloader to install the bootloader in the MBR or a boot partition, but isn’t used to generate the GRUB2 configuration files, and is thus incorrect. Option E is the fsck program, which checks and repairs hard drive partitions, and is an incorrect answer for this question.

17
Q

What command must you run to save changes to a GRUB Legacy boot menu?

mkinitrd
mkinitramfs
grub-mkconfig
grub-install
fsck
A

D. The grub-install command installs any configuration changes into the GRUB MBR, so option D is correct. The mkinitrd command creates a new initrd RAM disk image file, so option A is incorrect. Likewise, the mkinitramfs command (option B) is also used to create initrd image files on Debian systems, so it too is incorrect. The grub-mkconfig command is used in GRUB2 systems to create an updated configuration file but not in GRUB Legacy systems, so option C is incorrect. The fsck program checks and repairs hard drive partitions, so option E is incorrect.

18
Q

The ____ firmware method has replaced BIOS on most modern IBM-compatible computers.

FTP
UEFI
PXE
NFS
HTTPS
A

B. The UEFI firmware method has replaced the BIOS in most IBM-compatible computers, so option B is correct. FTP, PXE, NFS, and HTTPS are not firmware methods, but methods for loading the Linux bootloader, so options A, C, D, and E are all incorrect.

19
Q

What memory area does Linux use to store boot messages?

BIOS
The GRUB bootloader
The MBR
The initrd RAM disk
The kernel ring buffer
A

E. The kernel ring buffer is an area in memory reserved for storing output messages as the Linux system boots, so option E is correct. Option A, BIOS, is firmware on the workstation, not an area in memory, so it is incorrect. The GRUB bootloader, option B, is a program that starts the Linux system and is not in memory, so it is also incorrect. The MBR is a location on the hard drive to store the Linux bootloader, so option C is incorrect. The initrd RAM disk is an area in memory that stores modules required for the boot process, but it doesn’t store the boot messages as the system starts, so option D is incorrect.

20
Q

What command parameter would you add to the end of the GRUB2 linux command to force a Linux system to start in single-user mode?

single
fsck
mkinitrd
mkinitramfs
dmesg
A

A. The single command parameter instructs the Linux system to start in single-user mode after booting, so option A is correct. The fsck command checks and repairs hard drive partitions, so option B is incorrect. Both the mkinitrd and mkinitramfs commands create initrd RAM disk files, so options C and D are incorrect. The dmesg command displays the boot messages from the kernel ring buffer, so option E is incorrect.

21
Q

What is the term commonly used for when the Linux system halts due to a system error?

Kernel panic
Kernel ring buffer
initrd RAM disk
Bootloader
Firmware
A

A. A kernel panic occurs when a Linux system halts unexpectedly due to a system error, so option A is the correct term. The kernel ring buffer stores boot messages at boot time, so option B is incorrect. The initrd RAM disk is an area in memory that stores module files required to boot the system, so option C is incorrect. The bootloader and firmware are part of the Linux boot process and don’t refer to when the system halts, so options D and E are both incorrect.

22
Q

The ________ command generates the GRUB2 configuration used for booting.

mkinitrd
grub-mkconfig
grub-install
mkinitramfs
dmesg
A

B. The grub-mkconfig command processes GRUB2 directives stored in the /etc/grub.d folder to create the /etc/grub2.cfg configuration file, so option B is correct. The mkinitrd and mkinitramfs commands are used to create an initrd RAM disk to store module files, so options A and D are incorrect. The grub-install command is used in GRUB Legacy to install the GRUB configuration file in the correct location but isn’t used in GRUB2, so option C is incorrect. The dmesg command displays the system boot messages and isn’t part of the GRUB2 bootloader, so option E is incorrect.

23
Q

What program allows you to fix corrupted hard drive partitions?

mount
umount
fsck
dmesg
mkinitrd
A

C. The fsck program can perform a filesystem check and repair multiple types of filesystems on partitions. You should use it on any partition that can’t be mounted due to errors. The mount program (option A) is used to append a partition to a virtual directory; it can’t correct a partition that contains errors (and will usually refuse to mount them). The umount command (option B) is also incorrect. It is used to remove a mounted partition from the virtual directory. Option D (the dmesg command) displays boot messages, and option E (the mkinitrd command) crates an initrd RAM disk, so both are incorrect.

24
Q

Which command allows you to append a partition to the virtual directory on a running Linux system?

mount
umount
fsck
dmesg
mkinitramfs
A

A. The mount command allows you to specify both the partition and the location in the virtual directory where to append the partition files and folders. The files and folders contained in the partition then appear at that location in the virtual directory. The umount command (option B) is used to remove a mounted partition. Option C, the fsck command, is used to fix a hard drive that is corrupted and can’t be mounted; it doesn’t actually mount the drive itself. The dmesg command in option D is used to view boot messages for the system, which may tell you where a hard drive is appended to the virtual directory, but it doesn’t actually do the appending. Option E, the kninitramfs command, creates an initrd RAM disk and doesn’t directly handle mounting hard drives to the virtual directory.