Chapter 5 - Booting & Initializing Linux Flashcards

(85 cards)

1
Q

Describe the overall boot process

A
  1. Firmware runs the POST (power on self test) to check hardware
  2. Bootloader runs the chosen kernel
  3. The kernel is loaded and initializing runs
  4. Initialization process starts the initial services required for the system to operate.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are boot logs?

A

Logs created when computer is booted up.

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

what is dmesg?

A

Utility used to view recent log messages from the kernel ring buffer

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

what is POST?

A

performed immediately after a device is turned on. performed by firmware and checks hardware components.

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

what is journalctl?

A

utility to read logs. Logs read from a journal (/var/log/journal or /run/log/journal OR if wanting to see kernel-specific logs, use journalctl -k )
usually reads logs from its own journal daemon.

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

Where are logs stored in a RedHat distro?

A

/var/log/boot.log

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

Where are logs stored in a Debian distro?

A

/var/log/boot

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

what is a kernel ring buffer?

A

where boot kernel messages are stored in memory. it is circular and set to a predetermined size.

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

what is firmware?

A

software that provides low-level control of hardware

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

Steps of a BIOS startup:

A

POST
BIOS finds the bootloader by locating the MBR.

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

What is a MBR?

A

Holds the bootloader program.

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

where is MRB?

A

first sector on the first hard disk partition

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

From where can you load the bootloader program in a BIOS system?

A

internal/external hard drive
CD/DVD
USB
network server

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

what is chainloading?

A

when a bootloader program points to another bootloader program.

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

Steps of a UEFI startup?

A
  • register each individual boot loader file that you want to appear at boot time in the boot manager interface menu
  • firmware finds and runs the boot loader
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the ESP?

A

EFI system partition
special disk partition so now you can load multiple bootloaders or bootloaders of any size.

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

Where is ESP located?

A

/boot/efi

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

how to check if your system is a UEFI system or not?

A

ls /sys/firmware/efi

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

what is a bootloader?

A

bridge the gap between the system firmware and the full Linux operating system kernel. responsible for booting up the OS.

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

Grub legacy menu commands stored where?

A

/boot/grub

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

grub legacy config file is named what?

A

menu.lst or sometimes grub.conf

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

two sections in the grub legacy config file?

A

global definitions and OS boot definitions

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

example of global definitions in grub legacy config file?

A

color, default, timeout

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

examples of OS boot definitions in grub legacy config file?

A

Title, Root, kernel, Initrd, rootnoverify

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
what is initrd?
Defines the initial RAM disk file or filesystem, which contains drivers necessary for the kernel to interact with the system hardware.
26
what is rootnoverify?
efines non-Linux boot partitions, such as Windows.
27
how does grub legacy reference hard disks?
(hddrive, partition) both hard drive and partitions starting at 0
28
how to install grub legacy?
grub-install
29
Config file name in Grub2?
grub.cfg
30
where is grub.cfg located on a BIOS system? On a UEFI system?
BIOS: /boot/grub or /boot/grub2 UEFI: /boot/efi/EFI/distro-name
31
GRUB2 commands
menuentry, set root, linux or linux16, linuxefi, initrd, initdefi
32
how does grub2 reference hard disks?
hard drive starting at 0, partitions starting at 1
33
where is the editable grub2 config file located?
/etc/grub.d
34
how to install grub2?
grub-mkconfig or grub2-mkconfig
35
what does update-grub command do?
In Ubuntu, it issues the grub-mkconfig command for you.
36
ctrl-x in edit mode for grub2
Boot system with edited entry
37
gtrl-c in edit mode for grub2
Starts the GRUB command-line interface
38
E interacting with boot menu in grub2
Enters editing mode for currently selected menu option
39
how to add kernel boot parameters?
find line starting with kernel (grub legacy) or linux* (grub2). end of line + add space + add in the options.
40
what is a daemon?
process running continually in the background
41
what is init?
initialization daemon. determines what services are started and in which order.
42
SysVinit vs systemd
old, runs processes sequentially/linearly. slow/clunky new, runs processes in parallel
43
where is init binary stored? What is the command to figure it out?
/etc/init /bin/init or /sbin/init
44
what is a systemd unit file?
defines a service, a group of services, or an action
45
what are the 12 types of unit files?
automount mount device path swap socket snapshot slice scope service target timer
46
what is a target file?
a type of unit file that starts groups of services
47
what is systemctl and what does it do?
utility to manage systemd
48
name.type format is for what? example:
systemd units ex. sshd.service, graphical.target
49
where is systemd configuration file located?
/etc/systemd/system.conf
50
where are service unit file configs located?
/etc/systemd/system/ /run/systemd/system/ /usr/lib/systemd/system/
51
what does this command do? systemctl list-unit-files
To see the various service unit files available
52
what is in unit, type, and install configuration sections of a unit file?
[unit] - basic directives [type] - type specific directives. ex. service specific, automount, etc. [install] - enable/disable actions
53
command to find default target file?
systemctl get-default
54
Locations to NOT edit unit config files?
/lib/systemd/system/ or /usr/lib/systemd/system/
55
where to edit unit config files?
/etc/systemd/system/
56
what does the systemd-delta command do?
show files that are duplicated, extended, redirected and help avoid unintended consequences.
57
what does systemctl dameon-reload command do?
To have your changes take effect,
58
steps/commands to use when modifying systemd config files
1. make changes 2. systemd-delta 3. systemctl daemon-reload 4. systemctl restart
59
common systemctl commands
daemon-reload disable enable mask restart reload unmask start stop status
60
daemon-reload vs reload
daemon-reload = reloads all unit config files. does not restart the actual service. reload = reloads the current running service by reloading its own config
61
what does the systemctl isolate command do?
jumping between system targets
62
what does jumping to the rescue target do?
similar to sysvinit single user mode. meant for root user to repair the system local filesystem is mounted, limited services are run. in maintenance status
63
what is systemctl emergency mode?
mounts only the root filesystem as read-only root user can access, limited services are started in maintenance status used for situations where even rescue mode cannot be reached.
64
list all reboot commands
reboot telinit 6 shutdown -r now systemctl isolate reboot.target
65
list all shutdown commands
poweroff telinit 0 shutdown -h +1 system isolate poweroff.target
66
what is a runlevel?
Mode or a state in which the system operates. Defines what services are operating.
67
runlevel 0
Shut down the system
68
runlevel 1
single-user mode; used for maintenance. (like systemd rescue target)
69
runlevel 2
Multi-user mode without networking services enabled.
70
runlevel 3
Multi-user mode with networking services enabled.
71
runlevel 4
Custom
72
runlevel 5
Multi-user mode with GUI available.
73
runlevel 6
reboot the system
74
runlevel range for redhat? for debian?
0-6 for redhat 0-2, 6 for debian
75
explain the output of the runlevel command
shows two numbers. the first indicates the previous runlevel. the second indicates the current runlevel
76
what is /etc/inittab
configuration file. defines the default runlevel
77
where are initialization scripts stored?
/etc/init.d/
78
what is rc?
the script that calls the initialization scripts in the necessary location
79
what is in the /etc/rc.d directory?
subdirectories pertaining to each runlevel
80
what is /etc/rc.local?
add additional scripts and or commands. runs AFTER all other sysvinit scripts are executed.
81
what do the init & telinit commands do?
both are interchangeable. they allow you to jump between runlevels
82
what is a wall message
sends simple messages to certain system users logged on a tty terminal. sets their message status to "yes"
83
where are wall message located?
/bin/wall/ or /usr/bin/wall
84
what does the mesg command do?
check your message status
85
initramfs