IT Cert Ready

CompTIA

Linux+

Exam code: XK0-006

Start practicing

About this certification

Linux+ is a CompTIA certification. Exam code XK0-006. IT Cert Ready offers 1,191 practice questions with domain quizzes, full mock exams, and detailed explanations. Practice by official domain with 5 blueprint-aligned domains.

Official exam domain weights

Verified blueprint weights from the official exam outline.

  • Domain 1 · System Management · 23%
  • Domain 2 · Services and User Management · 20%
  • Domain 3 · Security · 18%
  • Domain 4 · Automation, Scripting, and AI · 17%
  • Domain 5 · Troubleshooting · 22%

Sample Linux+ practice questions

Preview realistic multiple-choice items from the IT Cert Ready question bank. Expand each answer for the correct choice and explanation—the same format used in domain quizzes and mock exams.

  1. Sample question 1 · Troubleshooting (22%)

    Pinnacle Regional Bank, a large multi-branch bank in the Midwest subject to federal banking examination requirements, suffered a credential theft incident traced to a phishing email. Post-incident, the security team found that an attacker had attempted to destroy evidence by corrupting the LVM configuration on a Linux log aggregation server. The server fails to boot, and the administrator boots into a rescue environment. Running 'pvs' shows the physical volume on /dev/sdc is in an unknown state, and 'vgchange -ay' fails with errors indicating the volume group metadata is inconsistent. The compliance team requires that LVM recovery steps be documented and that the volume group be restored using the most recent metadata backup before any log data is accessed. As the Linux administrator at Pinnacle Regional Bank, you are in the rescue environment and need to restore the corrupted LVM volume group metadata on /dev/sdc using the most recent archived backup to recover access to the log aggregation data. Which command correctly restores the LVM volume group metadata from the system's automatic backup archive?

    • A. pvcreate --restorefile /etc/lvm/backup/vg_logs /dev/sdc
    • B. vgcfgrestore -f /etc/lvm/archive/vg_logs_00001-XXXXXXXX.vg vg_logs
    • C. lvconvert --repair /dev/vg_logs/lv_data
    • D. vgimportclone --basevgname vg_logs /dev/sdc
    View answer & explanation

    Correct answer: B. vgcfgrestore -f /etc/lvm/archive/vg_logs_00001-XXXXXXXX.vg vg_logs

    [Domain 5 - Troubleshooting, Subtopic 5 - Troubleshooting - Area 1 - GRUB] Core Concept: Troubleshoot system, boot, and storage issues. centers on grub as defined in the official (ISC)² exam outline. Correct Answer (B): vgcfgrestore -f /etc/lvm/archive/vg_logs_00001-XXXXXXXX.vg vg_logs In this scenario, this choice best applies the mapped official task statement and accepted security practice to the facts presented. Why the other options are incorrect: Option A: 'pvcreate --restorefile' initializes a physical volume using a metadata backup file, but this operation reinitializes the PV header rather than restoring the volume group metadata; it is used when a PV UUID must be restored, not for correcting inconsistent VG metadata across an existing PV. Option C: 'lvconvert --repair' is used to repair a degraded RAID logical volume within LVM, not to restore corrupted volume group metadata; it does not address the VG metadata inconsistency reported by 'vgchange'. Option D: 'vgimportclone' is used to import a cloned or duplicated volume group with a new name and UUIDs to avoid conflicts, not to restore corrupted metadata on an existing volume group in place.

  2. Sample question 2 · Troubleshooting (22%)

    Pelindra Systems, a large precision manufacturing conglomerate with facilities across Southeast Asia, operates a Linux file server that hosts production scheduling data on an ext4 filesystem mounted at /data. Operators report that files are intermittently unreadable and the system log shows repeated kernel messages: 'EXT4-fs error (device sdd1): ext4_find_entry: reading directory #131073 offset 0' and 'Buffer I/O error on device sdd1, logical block 262144.' The filesystem is currently mounted read-write. The Linux administrator must repair the filesystem to restore reliable access to production data. As the Linux administrator, which action represents the correct first step to safely repair the ext4 filesystem on /dev/sdd1 and address the reported disk errors?

    • A. Run fsck.ext4 -y /dev/sdd1 while the filesystem remains mounted read-write to repair errors without interrupting production access.
    • B. Unmount the filesystem with umount /data, then run fsck.ext4 -C0 -y /dev/sdd1 against the unmounted device to check and repair filesystem inconsistencies.
    • C. Run tune2fs -C 1 /dev/sdd1 to force a filesystem check on the next reboot, then reboot the server immediately to trigger the repair.
    • D. Run badblocks -sv /dev/sdd1 while the filesystem is mounted to generate a bad block list, then pass it directly to fsck.ext4 to repair the filesystem in a single step.
    View answer & explanation

    Correct answer: B. Unmount the filesystem with umount /data, then run fsck.ext4 -C0 -y /dev/sdd1 against the unmounted device to check and repair filesystem inconsistencies.

    [Domain 5 - Troubleshooting, Subtopic 5 - Troubleshooting - Area 2 - filesystem repair] Core Concept: Troubleshoot system, boot, and storage issues. centers on filesystem repair as defined in the official (ISC)² exam outline. Correct Answer (B): Unmount the filesystem with umount /data, then run fsck.ext4 -C0 -y /dev/sdd1 against the unmounted device to check and repair filesystem inconsistencies. Why the other options are incorrect: Option A: Running fsck on a mounted read-write filesystem is explicitly unsupported and dangerous; concurrent writes from the OS can conflict with fsck's repair operations, causing additional metadata corruption and potentially rendering the filesystem unrecoverable. Option C: Tune2fs -C 1 sets the mount count to trigger a check at next boot, but this approach delays repair, does not address active I/O errors occurring now, and a reboot without first unmounting and checking the filesystem may cause the OS to journal-replay a corrupted state. Option D: Badblocks should not be run on a mounted filesystem as it performs raw device reads that conflict with the live filesystem; additionally, passing a bad block list to fsck is a separate two-step process that does not replace the need to first unmount the filesystem and run fsck to repair directory and inode-level corruption already present.

  3. Sample question 3 · Troubleshooting (22%)

    Halcyon Medical Devices, a manufacturer subject to HIPAA technical safeguard requirements, operates a cluster of Linux servers running a critical patient data API service. The SIEM team flags that the API service on server 'hmd-app03' stopped responding to health checks at 02:14 UTC. The Linux administrator is tasked with reviewing service logs and network state to determine the root cause and produce a timestamped evidence summary for the compliance officer. The administrator suspects the service may have crashed or a dependent port may have become unavailable. As the Linux administrator, which combination of commands should be used to retrieve timestamped service failure logs and confirm the current listening state of the API service port, producing output suitable for a compliance incident report?

    • A. cat /var/log/messages | grep api && ps aux | grep api
    • B. journalctl -u hmd-api.service --since '2025-01-01 02:00:00' --until '2025-01-01 02:30:00' --no-pager ; ss -tlnp | grep LISTEN
    • C. tail -f /var/log/syslog | grep hmd-api && netstat -r
    • D. systemctl status hmd-api.service && lsof -i
    View answer & explanation

    Correct answer: B. journalctl -u hmd-api.service --since '2025-01-01 02:00:00' --until '2025-01-01 02:30:00' --no-pager ; ss -tlnp | grep LISTEN

    [Domain 5 - Troubleshooting, Subtopic 5 - Troubleshooting - Area 4 - service logs] Core Concept: Troubleshoot network and service failures. centers on service logs as defined in the official (ISC)² exam outline. Correct Answer (B): journalctl -u hmd-api.service --since '2025-01-01 02:00:00' --until '2025-01-01 02:30:00' --no-pager ; ss -tlnp | grep LISTEN Why the other options are incorrect: Option A: 'cat /var/log/messages' may not contain systemd unit logs depending on the rsyslog configuration, and 'ps aux | grep api' only shows whether the process is running now, not what caused the failure at 02:14 UTC; neither produces timestamped incident evidence. Option C: 'tail -f' streams live log output and is not suitable for reviewing a past event window; 'netstat -r' displays the routing table, which is unrelated to confirming whether the API service port is listening. Option D: 'systemctl status' provides only the last few log lines and current state, which is insufficient for a compliance report requiring the full failure context; 'lsof -i' lists all open network files system-wide without filtering to the specific service port, producing noisy output unsuitable for documentation.

  4. Sample question 4 · Troubleshooting (22%)

    Harborview Community Bank, a small community bank in the Pacific Northwest operating under strict state banking regulations, experienced a spear-phishing attack that led to unauthorized access to a Linux-based transaction processing server. During forensic triage, the on-call Linux administrator discovers that the server's root filesystem, mounted on an ext4 volume, is reporting errors and the system entered emergency mode on its last boot attempt. The systemd journal shows repeated 'EXT4-fs error' messages referencing inode table corruption. The compliance officer requires that all repair actions be logged and that the filesystem be checked and repaired in a manner that preserves as much evidence as possible before the system is returned to production. As the Linux administrator at Harborview Community Bank, you have booted the affected server from a live recovery medium and need to repair the corrupted ext4 root filesystem on /dev/sdb1 while generating a detailed log of all findings for the compliance audit. Which command best accomplishes this goal?

    • A. mount -o remount,rw /dev/sdb1 /mnt && fsck.ext4 /dev/sdb1
    • B. fsck.ext4 -y -v -C 0 /dev/sdb1 2>&1 | tee /mnt/usb/fsck_audit.log
    • C. e2fsck -n /dev/sdb1 > /mnt/usb/fsck_audit.log
    • D. debugfs -w /dev/sdb1 -R 'dump_inode <2> /mnt/usb/inode.log'
    View answer & explanation

    Correct answer: B. fsck.ext4 -y -v -C 0 /dev/sdb1 2>&1 | tee /mnt/usb/fsck_audit.log

    [Domain 5 - Troubleshooting, Subtopic 5 - Troubleshooting - Area 2 - filesystem repair] Core Concept: Troubleshoot system, boot, and storage issues. centers on filesystem repair as defined in the official (ISC)² exam outline. Correct Answer (B): fsck.ext4 -y -v -C 0 /dev/sdb1 2>&1 | tee /mnt/usb/fsck_audit.log In this scenario, this choice best applies the mapped official task statement and accepted security practice to the facts presented. Why the other options are incorrect: Option A: Remounting the filesystem read-write before running fsck is dangerous and incorrect; fsck must be run on an unmounted filesystem to avoid data corruption, and mounting it first violates forensic evidence preservation principles. Option C: The '-n' flag instructs e2fsck to perform a read-only check and make no repairs, which satisfies evidence preservation but does not fulfill the requirement to repair the filesystem so it can be returned to production. Option D: 'debugfs' is a low-level interactive debugging tool for ext2/3/4 filesystems; while useful for manual forensic inspection, it does not perform automated filesystem repair and the command syntax shown does not address the inode table corruption reported in the journal.

  5. Sample question 5 · Troubleshooting (22%)

    Crestline Indemnity Corporation, a large national insurance carrier operating under strict regulatory backup-validation requirements, is performing an annual DR tabletop exercise. During the exercise, a simulated ransomware event corrupts the superblock of the ext4 filesystem on /dev/sdb1, which hosts archived claims data. The Linux administrator restores the volume from tape but upon mounting receives: 'mount: /dev/sdb1: can't read superblock.' The backup team confirms the restore completed without tape errors. The administrator needs to repair the filesystem without losing recoverable data before the exercise timer expires. As the Linux administrator, which command should be run first to attempt filesystem repair using an alternate superblock on the restored /dev/sdb1 volume?

    • A. mkfs.ext4 -F /dev/sdb1
    • B. fsck.ext4 -b 32768 /dev/sdb1
    • C. tune2fs -l /dev/sdb1
    • D. dd if=/dev/zero of=/dev/sdb1 bs=512 count=1
    View answer & explanation

    Correct answer: B. fsck.ext4 -b 32768 /dev/sdb1

    [Domain 5 - Troubleshooting, Subtopic 5 - Troubleshooting - Area 2 - filesystem repair] Core Concept: Troubleshoot system, boot, and storage issues. centers on filesystem repair as defined in the official (ISC)² exam outline. Correct Answer (B): fsck.ext4 -b 32768 /dev/sdb1 In this scenario, this choice best applies the mapped official task statement and accepted security practice to the facts presented. Why the other options are incorrect: Option A: Mkfs.ext4 -F formats the partition entirely, destroying all restored data and defeating the purpose of the tape recovery; this is never an appropriate first step when data preservation is required. Option C: Tune2fs -l attempts to read filesystem parameters from the primary superblock, which is already confirmed corrupt, so this command will fail with the same error and provides no repair capability. Option D: Writing zeros with dd to the first 512 bytes destroys the partition boot record and any remaining superblock fragments, making data recovery impossible and compounding the failure rather than resolving it.

Linux+ exam prep FAQ

What is the passing score for the Linux+ exam?
The Linux+ exam uses a scaled score. A common published passing threshold is 720 on a scale of 100–900. Always confirm the current requirement on the official CompTIA exam guide before you sit for the test.
How many questions are on the Linux+ certification exam?
The live Linux+ exam typically includes 90 questions (maximum) with about 90 minutes on the clock. Formats can vary by delivery mode and exam update.
How do domain quizzes help with Linux+ exam prep?
Domain quizzes on IT Cert Ready let you practice Linux+ one blueprint domain at a time across 5 official exam domains. You get immediate feedback, detailed explanations, and can revisit weak areas before taking a full timed mock exam.
How many Linux+ practice questions are on IT Cert Ready?
IT Cert Ready includes 1,191 published Linux+ practice questions with domain quizzes, full-length mock exams, and answer explanations mapped to the official outline.