Unit 6 - Practice Quiz
1
In Linux, a hard drive like /dev/sda is an example of which type of device?
2 Which directory in the Linux filesystem is the standard location for device files?
/var
/etc
/bin
/dev
3 Which command would you use to list information about PCI devices, such as network cards or graphics cards?
lsblk
lsusb
lscpu
lspci
4
What is the primary role of the udev daemon in a modern Linux system?
/dev.
5 To check the amount of free and used memory on a Linux system, which command is most appropriate?
iostat
du
free
df
6 Which command is used to display messages from the kernel's ring buffer, which is useful for seeing information about hardware detection during startup?
logread
dmesg
cat /var/log/syslog
journalctl
7 If a computer's system clock is consistently wrong after being powered off, what is the most likely hardware component to have failed?
8 A newly installed hard drive is not showing up. After checking physical connections, what is a good command to see if the Linux kernel has detected the drive at a low level?
ifconfig
dmesg | grep sda
netstat
ls -l
9 What is the primary function of an IP address?
10 In the TCP/IP suite, which protocol is responsible for providing reliable, connection-oriented communication?
11 A server that is primarily responsible for storing files and making them available to other computers on the network is known as a:
12
Which type of server translates domain names like www.example.com into IP addresses like 93.184.216.34?
13 Which of the following commands is commonly used on modern Linux systems to view the IP address of a network interface?
configip
ip addr show
netstat -i
show ip address
14 What is the purpose of a default gateway in a network configuration?
15 What service automatically assigns IP addresses to devices when they connect to a network?
16 On a typical Linux system, which file would you edit to manually specify the DNS servers to be used for name resolution?
/etc/hosts
/etc/hostname
/etc/network/interfaces
/etc/resolv.conf
17 What is the term for the software that creates and runs virtual machines?
18 Which of these is a key benefit of using virtualization?
19 Which command is the most fundamental tool for testing if a remote host is reachable across a network?
ping
netstat
ftp
ssh
20
If you can ping an external IP address but cannot browse any websites by their domain names, what is the most likely cause of the problem?
21
An administrator runs ls -l /dev and sees the following two entries:
brw-rw---- 1 root disk 8, 0 Jan 1 10:00 sda
crw-rw---- 1 root tty 4, 64 Jan 1 10:00 ttyS0
Based on the first character of the permissions string (b and c), what is the fundamental difference between /dev/sda and /dev/ttyS0?
22 A system administrator needs to test a backup script that generates a large output file, but they want to avoid actually writing the data to disk to save space and time during the test. Which pseudo-device is the most appropriate target for redirecting the script's output?
23
You have physically installed a new, unformatted hard drive /dev/sdb into a Linux server. Which sequence of commands is the correct order to partition the drive, create an ext4 filesystem on the first partition, and mount it to /mnt/newdata?
fdisk /dev/sdb -> mkfs.ext4 /dev/sdb1 -> mkdir /mnt/newdata -> mount /dev/sdb1 /mnt/newdata
mount /dev/sdb /mnt/newdata -> fdisk /dev/sdb -> mkfs.ext4 /dev/sdb1
fdisk /dev/sdb -> mount /dev/sdb /mnt/newdata -> mkfs.ext4 /dev/sdb1
mkfs.ext4 /dev/sdb1 -> fdisk /dev/sdb -> mount /dev/sdb1 /mnt/newdata
24
An administrator has a USB webcam that is sometimes detected as /dev/video0 and other times as /dev/video1, causing an application to fail. What is the most robust method to create a persistent, custom device name like /dev/webcam that always points to this specific camera?
alias command in the shell's profile to map webcam to the correct device.
udev rule that identifies the device by its unique vendor and product ID and creates a persistent symbolic link.
/etc/fstab file to map the device name.
ln -s /dev/video0 /dev/webcam in a startup script.
25
The df -h command shows that the root filesystem (/) is 98% full. An administrator suspects that log files in /var/log are the cause. Which of the following commands is most effective for listing the subdirectories and files within /var/log sorted by their size to quickly identify the largest ones?
du -ah /var/log | sort -hr | head -n 10
iostat -d /var/log
ls -lh /var/log
find /var/log -type f
26
While investigating slow application performance, a system administrator runs iostat -x 1 and observes a consistently high %iowait value (over 40%) for the primary disk sda. What is the most likely cause of the performance issue?
27
A server fails to boot, and the console displays the error: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0). Which of the following is the most logical first step in troubleshooting this issue?
28
A system is experiencing random crashes and data corruption. Suspecting a memory issue, the administrator boots the server using a live CD and runs memtest86+. The test quickly shows a large number of red errors scrolling on the screen. What is the correct interpretation and action?
29
A computer has an IP address of 172.16.100.5 and a subnet mask of 255.255.240.0. What is the primary function of this subnet mask?
30 When would a developer choose to use UDP over TCP for their application's transport protocol?
31 A company needs to set up a new Linux server with the following functions: 1) Host the company's public website. 2) Allow employees to securely transfer files to and from the server from remote locations. 3) Resolve domain names to IP addresses for the local network. Which combination of server software best meets these requirements?
32 A web application architecture consists of several backend application servers. To improve security and manage traffic, a single server is placed in front of them. This server accepts all incoming HTTPS requests from the internet, terminates the SSL, and then forwards the requests to the appropriate backend server based on the URL. What is the role of this front-facing server?
33 An administrator needs to configure a static IP address on a modern Ubuntu 22.04 server. After editing the appropriate configuration file, the network interface is still using the old DHCP-assigned address. What crucial command was likely missed?
nmcli connection reload
systemctl restart networking.service
ifdown enp0s3 && ifup enp0s3
netplan apply
34
A server is configured with the IP address 192.168.1.50/24 but its default gateway is incorrectly set to 192.168.2.1. Which of the following statements accurately describes the server's connectivity?
192.168.1.0/24 network.
192.168.1.0/24 network but cannot reach the internet.
35
A user on a Linux workstation can successfully ping 8.8.8.8 but ping www.google.com fails. The administrator checks the /etc/resolv.conf file and sees it contains only the line nameserver 127.0.0.53. Which of the following is the most likely issue?
systemd-resolved) is running but is failing to forward queries to an upstream DNS server.
36
A newly installed Linux client is not receiving an IP address. To troubleshoot, an administrator runs dhclient -v eth0 and sees continuous DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval... messages, but no DHCPOFFER messages appear. What is the most probable cause of this issue?
/etc/resolv.conf file is empty.
37 An administrator is choosing a hypervisor for a production server. They need maximum performance and want the hypervisor to run directly on the server's hardware without a traditional host operating system. Which type of hypervisor and corresponding example fits this requirement?
38
An administrator has a libvirt XML file named centos-vm.xml that defines a new virtual machine. They want to make the VM known to the hypervisor permanently but not start it immediately. After that, they want to check its status. Which sequence of virsh commands accomplishes this?
virsh create centos-vm.xml followed by virsh status centos-vm
virsh start centos-vm.xml followed by virsh list
virsh attach-device centos-vm.xml followed by virsh dominfo centos-vm
virsh define centos-vm.xml followed by virsh list --all
39
A user on a corporate network can access internal company websites but cannot access any external websites like google.com. An administrator on the user's machine successfully runs ping 8.8.8.8. What is the most likely reason the user cannot browse external sites?
40
To diagnose a connection failure to a remote server, an administrator runs traceroute remote.server.com. The output shows the first few hops within the local network successfully, but then every subsequent line shows three asterisks (* * *) and the command eventually times out. What is the most likely interpretation?
remote.server.com is down.
41
A system administrator creates a custom udev rule in /etc/udev/rules.d/65-custom-storage.rules to assign a persistent name /dev/special_disk to a specific USB drive based on its serial number. However, after plugging in the device, it is still being named /dev/sdc by the default system rules located in /lib/udev/rules.d/60-persistent-storage.rules. What is the most likely reason the custom rule is not being applied as expected, and how can it be fixed?
65-custom-storage.rules) gives it lower precedence than the system rule (60-persistent-storage.rules). The file should be renamed to 55-custom-storage.rules.
udev daemon needs to be reloaded using udevadm control --reload-rules && udevadm trigger for the new rule file to be recognized and applied to the existing device.
OPTIONS+="last_rule" directive, which would prevent later, lower-precedence rules like the default one from overwriting the name.
udev daemon processes rules in lexicographical order. Since 65- comes after 60-, the custom rule is being processed later and should be taking precedence. The issue is likely a syntax error in the rule itself, such as an incorrect ATTRS{serial} value.
42
You are analyzing a system and observe two device special files: /dev/nvram, a character device with major:minor numbers 10:144, and /dev/loop0, a block device with major:minor numbers 7:0. If you run the command dd if=/dev/urandom of=/dev/TARGET bs=1K count=1, which of the following best describes the expected difference in behavior when TARGET is nvram versus loop0?
dd command will write a 1KB block to both devices.
/dev/nvram is processed immediately by the driver as a stream of bytes without buffering by the kernel's block layer, while data written to /dev/loop0 is buffered, potentially reordered, and written in discrete blocks.
dd command will write a stream of 1024 characters to /dev/nvram, but for /dev/loop0, it will align the write to the underlying block size of the backing file, potentially writing more than 1KB.
/dev/loop0 (if associated with a file) but fail for /dev/nvram because character devices do not support block-based operations like dd.
43
You are configuring Device Mapper Multipath (DM-MPIO) for a storage array on a Linux server. The array supports Asymmetric Logical Unit Access (ALUA), where paths to a LUN can be in 'active/optimized' or 'active/non-optimized' states. You observe that all I/O is being sent down non-optimized paths, leading to poor performance. Which multipath.conf configuration block is most likely missing or misconfigured?
devices block for the specific storage array vendor/product with path_checker set to alua and prio set to alua.
devices block for the specific storage array vendor/product with path_checker set to tur and prio set to const.
defaults block with no_path_retry set to queue.
defaults block with path_grouping_policy set to failover.
44
A high-performance server with an NVMe SSD is exhibiting significantly lower IOPS than specified. You run lspci -vv -s <device_id> and find the line LnkSta: Speed 8GT/s, Width x2. The drive and motherboard both support PCIe 3.0 x4. All BIOS/UEFI performance settings are enabled. What is the most plausible underlying hardware issue?
nvme-cli tool needs to be used to manually set the link width to x4.
45
While analyzing the output of iostat -x 1, you see the following for a busy disk /dev/sdb:
r/s w/s rMB/s wMB/s rrqm/s wrqm/s %rrqm %wrqm r_await w_await aqu-sz rareq-sz wareq-sz svctm %util
0.00 1200.00 0.00 4.69 0.00 2400.00 0.00 66.67 0.00 8.30 9.96 0.00 4.00 0.83 99.60
Given the very high %util (99.60) but a seemingly low service time (svctm of 0.83 ms), what is the most accurate interpretation of this device's performance state?
svctm value is deprecated and inaccurate; the high w_await (8.30 ms) is the true indicator of a severe performance bottleneck.
wrqm/s is high) into larger physical writes, making the device highly utilized but efficient on a per-operation basis.
svctm is misleading because the queue size (aqu-sz near 10) and wait time (w_await) show that requests are spending most of their time waiting to be serviced, not being serviced.
46
A Linux server crashes and generates a Machine Check Exception (MCE), logged by mcelog. The decoded output includes CPU 0 BANK 5, ADDR 1f8f7b0c0, and MISC d0120001 00000086. The status register MCG_STATUS is 0x0. What is the most precise troubleshooting step to take next based on this information?
edac-utils tool to correlate the physical address (ADDR) to a specific memory DIMM slot to identify the likely faulty RAM module.
MCG_STATUS is 0x0), so the admin should monitor for recurrences before taking action.
memtester or memtest86+, as BANK 5 in an MCE context typically refers to a memory controller error related to a specific DIMM.
47
You are analyzing a tcpdump capture of a file transfer between two servers on a 10 Gbps network with a round-trip time of 80ms. You notice the throughput is capped at approximately 6.5 Mbps. The capture shows that the TCP Window Size in the packets from the receiver never exceeds 65535 bytes, and the Window Scale option is absent in the SYN packets. What is the primary limiting factor, and what is its theoretical maximum throughput?
48
Two Docker containers on the same host, attached to the same user-defined bridge network, cannot communicate with each other. They can both, however, reach external networks successfully. iptables -L -n -v on the host shows no DROP or REJECT rules in the FORWARD chain or the DOCKER-USER chain. What is the most likely cause for the intra-bridge communication failure?
net.ipv4.ip_forward sysctl parameter is set to 0.
com.docker.network.bridge.enable_icc option was set to false for that specific user-defined bridge network.
--iptables=false, preventing it from managing firewall rules.
49
A Linux client is configured with multiple network interfaces, each receiving DNS server information via DHCP from different scopes. The system is managed by systemd-resolved. The administrator wants to ensure that any DNS queries for the domain internal.corp.com are only ever sent to the DNS server provided on interface eth1 (10.10.0.1), while all other queries are resolved by servers on eth0. Which of the following is the most robust method to configure this split-DNS behavior?
10.10.0.1 internal.corp.com to the /etc/hosts file.
/etc/resolv.conf to add nameserver 10.10.0.1 and search internal.corp.com.
/etc/systemd/network/10-eth1.network with [Match] section for eth1 and a [Network] section containing DNS=10.10.0.1 and Domains=~internal.corp.com.
nmcli to set ipv4.dns-search to internal.corp.com for the eth1 connection profile.
50 A company requires a centralized authentication system for its Linux servers that provides not only user authentication (via Kerberos) and directory services (via LDAP), but also integrated management of Host-Based Access Control (HBAC) rules and sudo policies from a central location. Which server role/solution is designed to provide all of these features in a single, integrated platform?
sudo-ldap.
51
An administrator configures a network bond bond0 using mode=1 (active-backup). The primary slave interface is eth0 and the backup is eth1. During a test, they physically disconnect eth0. They observe a packet loss period of 5-10 seconds before traffic resumes over eth1. They want to reduce this failover time to be nearly instantaneous. Which combination of bonding parameters should be adjusted to achieve the fastest possible failover detection?
miimon value to a low number like 10 and set use_carrier=0.
arp_interval and arp_ip_target parameters and set miimon=0.
mode=0 (round-robin) as it doesn't require failover.
mode=4 (802.3ad) and configure LACP on the switch.
52 You are optimizing a KVM guest that runs a write-intensive database. The guest's virtual disk is a qcow2 file on a host EXT4 filesystem. To maximize performance and ensure data integrity in case of host power failure, which combination of cache mode and I/O mode is optimal for the virtual disk configuration?
cache='unsafe', io='threads'
cache='none', io='native'
cache='writeback', io='native'
cache='writethrough', io='threads'
53
An administrator is using cloud-init to provision a cloud server and needs to ensure that a specific block device, /dev/sdb, is always formatted with XFS and mounted on /data across reboots. The formatting should only happen if the device is not already an XFS filesystem. Which cloud-init user-data configuration correctly and idempotently accomplishes this?
bootcmd module that checks if /dev/sdb is mounted and, if not, formats and mounts it.
disk_setup module to partition the disk, followed by a runcmd to format and mount it.
fs_setup module to define the filesystem label and type, combined with a mounts module that specifies the mount point and filesystem type.
runcmd module that executes mkfs.xfs -f /dev/sdb and then adds an entry to /etc/fstab.
54 A Linux server (10.0.0.10/24) cannot communicate with another server (10.0.0.20/24) on the same VLAN and IP subnet. Both servers can ping the gateway (10.0.0.1) and access the internet. A packet capture on 10.0.0.10 shows it sends ARP requests for 10.0.0.20, but receives no replies. A capture on 10.0.0.20 shows it never receives these ARP requests. The physical cabling is confirmed to be good. What is the most likely network infrastructure misconfiguration?
55
During a network analysis with ss -ti, you observe a TCP connection with a high number of retransmissions. The output shows rto:1000, rtt:50/25, and a cwnd that is fluctuating wildly but never growing large. What does the rtt:50/25 value specifically indicate about the network path's condition?
56
You are using the perf tool to diagnose a performance issue and run perf record -g -a sleep 10 followed by perf report. The report shows that a significant amount of CPU time (e.g., 30%) is being spent inside the [k] copy_page_to_iter_iovec kernel function. This is observed during a high-I/O workload. What does this specific kernel function's high CPU usage most strongly suggest?
57
A server has been configured with Policy-Based Routing using ip rule and custom routing tables. The goal is to route traffic from source IP 192.168.10.50 out via gateway 10.0.1.1, and all other traffic out via the default gateway 10.0.0.1. The configuration is as follows:
1. ip rule add from 192.168.10.50/32 table 100
2. ip route add default via 10.0.1.1 dev eth1 table 100
3. The main table has default via 10.0.0.1 dev eth0.
However, traffic from 192.168.10.50 is still exiting via gateway 10.0.0.1. What is the most likely missing configuration step?
local and main.
rp_filter) is dropping the packets because the return path is asymmetric.
10.0.1.0/24 is missing from routing table 100.
ip route flush cache to apply the changes.
58
A Linux client managed by NetworkManager receives its IP via DHCP. The administrator wants to override the DHCP-provided DNS servers with 1.1.1.1 and 1.0.0.1 but also prevent /etc/resolv.conf from ever being modified by NetworkManager, as another application directly manages it. Which nmcli command sequence accomplishes this specific goal?
rc-manager=unmanaged in the [main] section of /etc/NetworkManager/NetworkManager.conf
nmcli con mod 'eth0' ipv4.dns "1.1.1.1 1.0.0.1"
dns=none in the [main] section of /etc/NetworkManager/NetworkManager.conf
nmcli con mod 'eth0' ipv4.dns "1.1.1.1 1.0.0.1" and nmcli con mod 'eth0' ipv4.ignore-auto-dns yes
59 You are designing a high-availability database cluster using a Galera-based solution (e.g., MariaDB Galera Cluster, Percona XtraDB Cluster). A critical requirement is to prevent 'split-brain' scenarios where network partitions could lead to divergent datasets. Which server role is essential to deploy alongside the database nodes to maintain cluster quorum in a robust manner, especially in clusters with an even number of nodes?
garbd) daemon running on a separate, independent machine.
xtrabackup.
60
A system administrator needs to pass a specific kernel command-line parameter iommu=pt to a KVM virtual machine to enable PCI passthrough. They are using libvirt to manage the VM. Modifying the GRUB configuration inside the guest is not a viable option. What is the correct way to inject this kernel argument into the guest from the host using virsh or the VM's XML definition?
mkfs.xfs -i maxpct=50 /dev/sdc
mkfs.xfs -i size=512 /dev/sdc
mkfs.xfs -m maxpct=50 /dev/sdc
mkfs.xfs -i inobpc=2048 /dev/sdc