010-160 - LPI Linux Essentials Hardware and Operating Systems Questions and Answers — Questions and Answers
Question 1: A system administrator needs to gather detailed information about the CPU architecture, such as the number of cores, threads per core, and CPU family. Which command provides a comprehensive, human-readable summary of this information?
- cat /proc/cpuinfo
- lscpu (Correct answer)
- uname -p
- dmesg | grep CPU
Correct answer: lscpu
The `lscpu` command gathers CPU architecture information from sysfs and /proc/cpuinfo and displays it in an easy-to-read, summarized format. While `cat /proc/cpuinfo` contains the raw data, `lscpu` organizes it more clearly. `uname -p` only shows the processor architecture type, and `dmesg` shows kernel messages, which may include CPU information at boot, but it is not its primary purpose to provide a clean summary.
Question 2: What is the primary role of the BIOS or UEFI in the Linux boot process?
- To load the graphical user interface.
- To mount the root filesystem.
- To initialize hardware and load the bootloader. (Correct answer)
- To start system services and daemons.
Correct answer: To initialize hardware and load the bootloader.
The BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) is the first software that runs when a computer is powered on. Its primary responsibilities are to perform a Power-On Self-Test (POST) to initialize and check system hardware, and then to locate and hand over control to the bootloader (like GRUB) from a storage device.
Question 3: Which of the following best describes the purpose of a kernel module in Linux?
- A user-space application that monitors system performance.
- A script that runs at boot time to configure network settings.
- A piece of code that can be loaded into the kernel to extend its functionality, such as for a device driver. (Correct answer)
- The central, monolithic part of the kernel that manages core system processes.
Correct answer: A piece of code that can be loaded into the kernel to extend its functionality, such as for a device driver.
Kernel modules are pieces of code that can be loaded into and unloaded from the kernel on demand, without rebooting the system. They are most commonly used to add support for new hardware (as device drivers), filesystems, or system calls, thereby extending the kernel's capabilities.
Question 4: A user plugs in a new USB flash drive and wants to identify it from the command line. Which of the following commands is specifically designed to list information about all connected USB devices?
- lsblk
- fdisk -l
- lsusb (Correct answer)
- lshw
Correct answer: lsusb
The `lsusb` command is the standard utility for displaying information about USB buses in the system and the devices connected to them. While `lsblk` and `fdisk -l` show block devices (which the USB drive is), they are more general. `lshw` provides detailed hardware information for the whole system but is less direct for specifically identifying USB devices.
Question 5: Which virtual filesystem in Linux provides an interface to kernel data structures and information about system processes?
- /dev
- /sys
- /tmp
- /proc (Correct answer)
Correct answer: /proc
The `/proc` filesystem is a special, pseudo-filesystem that provides an interface to kernel data structures. It doesn't contain real files but runtime system information, such as system memory, devices mounted, and hardware configuration. It contains a directory for each running process, identified by its process ID (PID).
Question 6: After a system reboot, a technician wants to review the messages generated by the kernel during the startup sequence to troubleshoot a potential hardware detection issue. Which command is most suitable for viewing these kernel ring buffer messages?
- journalctl -u kernel
- cat /var/log/syslog
- dmesg (Correct answer)
- history
Correct answer: dmesg
`dmesg` (display message or driver message) is used to examine or control the kernel ring buffer. It prints the messages generated by the kernel, including those from the boot process related to hardware detection and driver initialization. While logs might be in `/var/log/syslog` or accessible via `journalctl`, `dmesg` is the most direct and traditional tool for this specific purpose.
A system administrator needs to gather detailed information about the CPU architecture, such as the number of cores, threads per core, and CPU family.
Which command provides a comprehensive, human-readable summary of this information?