Chapter 16. Linux Kernel Flashcards

1
Q

Which command shows the current version of the kernel that is used on your computer?

A

uname -r shows the current version of the kernel on a computer.

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

Where do you find current version information about your RHEL 8 installation?

A

Current version information about your RHEL 8 installation is found in /etc/redhat-release.

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

Which command shows a list of kernel modules that currently are loaded?

A

lsmod shows a list of currently loaded kernel modules.

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

Which command enables you to discover kernel module parameters?

A

“modinfo modulename” displays kernel module parameters.

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

How do you unload a kernel module?

A

modprobe -r unloads a kernel module.

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

What can you do if you get an error message while trying to unload a kernel module?

A
Use lsmod to find out which other kernel modules currently need this kernel module and unload these kernel modules first. 
Note that this will not always work, especially if the considered hardware currently is in use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you find which kernel module parameters are supported?

A

Use modinfo to find which kernel module parameters are supported.

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

Where do you specify kernel module parameters that should be used persistently?

A

Create a file in /etc/modprobe.d and include the parameters using an options statement.

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

Assuming that the cdrom module has a parameter debug, which must be set to 1 to enable debug mode, which line would you include in the file that will automatically load that module?

A

include options “cdrom debug=1” in the file that will automatically load the cdrom module.

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

How do you install a new version of the kernel?

A

“yum upgrade kernel” installs a new version of the kernel.

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

What causes a tainted kernel?

a. A kernel driver that is not available as an open source driver
b. A driver that was developed for a different operating system but has been ported to Linux
c. A driver that has failed
d. An unsupported driver

A

A.

A tainted kernel is caused by drivers that are not available as open source drivers. Using these may have an impact on the stability of the Linux operating system, which is why it is good to have an option to recognize them easily.

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

What is the name of the command that shows kernel events since booting?

a. logger
b. dmesg
c. klogd
d. journald

A

B.

The dmesg utility shows the contents of the kernel ring buffer. This is the area of memory where the Linux kernel logs information to, so it gives a clear overview of recent kernel events.

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

Which command enables you to find the actual version of the kernel that is used?

a. uname -r
b. uname -v
c. procinfo -k
d. procinfo -l

A

A.

The uname -r command shows the current kernel version. The uname -v command gives information about the hardware in your computer, and the procinfo command does not exist.

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

Which command shows the current version of RHEL you are using?

a. uname -r
b. cat /proc/rhel-version
c. cat /etc/redhat-release
d. uname -k

A

C.

The “/etc/redhat-release” version contains information about the current version of RHEL you are using, including the update level.

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

What is the name of the process that helps the kernel to initialize hardware devices properly?

a. systemd-udevd
b. hwinit
c. udev
d. udevd

A

A.

On a systemd-based operating system such as RHEL 8, the systemd-udevd process takes care of initializing new hardware devices.

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

Where does your system find the default rules that are used for initializing new hardware devices?

a. /etc/udev/rules.d
b. /usr/lib/udev/rules.d
c. /usr/lib/udev.d/rules
d. /etc/udev.d/rules

A

B.

Default rules for hardware initialization are in the directory /usr/lib/udev/rules.d;
custom rules should be stored in /etc/udev/rules.d

17
Q

Which command should you use to unload a kernel module, including all of its dependencies?

a. rmmod
b. insmod -r
c. modprobe -r
d. modprobe

A

C.

The modprobe command is the only command that should be used for managing kernel modules, as it considers kernel module dependencies as well. Use modprobe to load a kernel module and modprobe -r to unload it from memory.

18
Q

Which command enables you to see whether the appropriate kernel modules have been loaded for hardware in your server?

a. lsmod
b. modprobe -l
c. lspci -k
d. lspci

A

C.

The lspci -k command lists devices that are detected on the PCI bus and supporting kernel modules that have been loaded for those devices. Alternatively, lspci -v shows more verbose information about modules that are currently loaded.

19
Q

Where do you specify a kernel module parameter to make it persistent?

a. /etc/modules.conf
b. /etc/modprobe.conf
c. /etc/modprobe.d/somefilename
d. /usr/lib/modprobe.d/somefilename

A

C.

The /etc/modprobe.d directory is used for files that create custom configurations. The files /etc/modules.conf and modprobe.conf were used for this purpose in the past. On RHEL 8, kernel module parameters are passed
through /usr/lib/modprobe.d if they are used for operating system–managed permanent parameters.
20
Q

Which statements about updating the kernel are not true?

a. The yum update kernel command will install a new kernel and not update it.
b. The yum install kernel command will install a new kernel and keep the old kernel.
c. The kernel package should be set as a yum-protected package to ensure that after an update the old kernel is still available.
d. After you have installed a new kernel version, you must run the grub2-mkconfig command to modify the GRUB 2 boot menu so that it shows the old kernel and the newly installed kernel.

A

C and D.

Kernels are not updated; they are installed. You can use either yum update kernel or yum install kernel to do so. There are no additional requirements, which makes answers C and D false.