Linux+ CompTIA Linux+ Test System Architecture 3 — Questions and Answers
Question 1: An administrator wants to disable a service so it never starts at boot but can still be started manually. Which command achieves this with systemd?
- systemctl disable <service> (Correct answer)
- systemctl stop <service>
- systemctl mask <service>
- systemctl isolate <service>
Correct answer: systemctl disable <service>
systemctl disable removes the symlinks that cause a service to start at boot while leaving manual start available.
Question 2: Which file in /proc exposes the physical and virtual memory statistics the kernel maintains, such as MemTotal and SwapFree?
- /proc/meminfo (Correct answer)
- /proc/memory
- /proc/vmstat
- /proc/sysinfo
Correct answer: /proc/meminfo
/proc/meminfo contains detailed memory statistics including total RAM, free RAM, buffers, cached memory, and swap usage.
Question 3: A technician adds a new SATA SSD to a running Linux system. Which command should be run to make the kernel detect the new drive without rebooting?
- echo '- - -' > /sys/class/scsi_host/host0/scan (Correct answer)
- modprobe sata_ssd
- udevadm trigger --action=add
- hdparm -r /dev/sda
Correct answer: echo '- - -' > /sys/class/scsi_host/host0/scan
Writing '- - -' to a SCSI host's scan file triggers the kernel to rescan the SCSI/SATA bus for new devices without rebooting.
Question 4: Which CPU scheduling policy is designed for real-time processes that must run for a fixed time slice and then yield to other real-time tasks of equal priority?
- SCHED_RR (Correct answer)
- SCHED_FIFO
- SCHED_BATCH
- SCHED_IDLE
Correct answer: SCHED_RR
SCHED_RR (Round Robin) is a real-time policy that gives each process of equal priority a fixed time quantum before rotating.
Question 5: What is the function of the initramfs (initial RAM filesystem) during the Linux boot process?
- Provides a temporary root filesystem to load drivers needed to mount the real root (Correct answer)
- Stores the bootloader configuration permanently
- Replaces the kernel after POST completes
- Caches frequently accessed files for faster boot
Correct answer: Provides a temporary root filesystem to load drivers needed to mount the real root
The initramfs is a compressed cpio archive loaded into RAM that provides drivers and tools needed to locate and mount the real root filesystem.
Question 6: A Linux system has two CPUs. The administrator wants to prevent a specific process from running on CPU 0. Which command accomplishes this?
- taskset -c 1 <pid> (Correct answer)
- nice -n 0 <pid>
- renice -g 0 <pid>
- cpulimit --cpu 1 <pid>
Correct answer: taskset -c 1 <pid>
taskset -c 1 <pid> sets the CPU affinity mask so the process runs only on CPU 1, excluding CPU 0.
Question 7: Which kernel parameter file under /proc/sys controls the maximum number of open file descriptors system-wide?
- /proc/sys/fs/file-max (Correct answer)
- /proc/sys/kernel/maxfiles
- /proc/sys/fs/nr_open
- /proc/sys/kernel/ulimit
Correct answer: /proc/sys/fs/file-max
/proc/sys/fs/file-max sets the system-wide limit on the number of simultaneously open file descriptors.
An administrator wants to disable a service so it never starts at boot but can still be started manually.
Which command achieves this with systemd?