XK0-006 sample questions: 5 worked examples
Five scenario questions follow, one for each XK0-006 domain. Decide on an answer before opening the explanation, because the reasoning behind the wrong options is where most of the learning is. All five are written from CompTIA’s published objectives; none comes from a real exam.
Question 1. A logical volume mounted at /data is full, and the volume group has free extents. The filesystem is xfs. Which pair of actions grows the volume and its filesystem?
- A. lvextend, then resize2fs
- B. lvextend, then xfs_growfs
- C. pvcreate, then xfs_repair
- D. vgremove, then mkfs.xfs
Show answer
Answer: B
The logical volume must be extended first with lvextend, and then the xfs filesystem is grown with xfs_growfs. resize2fs is for ext filesystems, xfs cannot be shrunk or grown with it, and creating a new physical volume is unnecessary because the volume group already has free extents.
Want more questions like this? Full XK0-006 practice tests →
Question 2. A systemd service was edited and now fails to start. After correcting the unit file, which command should be run before restarting the service so systemd sees the new definition?
- A. systemctl mask
- B. systemctl enable
- C. systemctl daemon-reload
- D. systemctl reload
Show answer
Answer: C
systemctl daemon-reload makes systemd re-read unit files from disk. Enable only sets the service to start at boot, mask prevents it from being started at all, and reload asks the running service to reread its own configuration, not the unit definition.
Want more questions like this? Full XK0-006 practice tests →
Question 3. After moving a website's files to /srv/site, Apache returns 403 errors although file permissions are correct. SELinux is enforcing. Which action most directly fixes the issue?
- A. Define the web content file context with semanage and apply it with restorecon
- B. Set chmod 777 on the directory
- C. Disable SELinux permanently
- D. Change the umask to 000
Show answer
Answer: A
Moved files can keep the wrong SELinux context. Setting the correct type with semanage fcontext and applying it with restorecon fixes it while keeping SELinux enforcing. Setting permissions to 777 does not change the context, disabling SELinux weakens security, and changing the umask affects only new files.
Want more questions like this? Full XK0-006 practice tests →
Question 4. A script must stop and report an error if the previous command failed. Which test uses the return code of the last command?
- A. if [ $$ -ne 0 ]
- B. if [ $0 -ne 0 ]
- C. if [ $1 -ne 0 ]
- D. if [ $? -ne 0 ]
Show answer
Answer: D
The special variable $? holds the exit status of the last command, with 0 meaning success. $$ is the shell’s process ID, $0 is the script name and $1 is the first argument.
Want more questions like this? Full XK0-006 practice tests →
Question 5. A server can ping its default gateway by IP address but cannot reach any host by name. Which file or service should be checked first?
- A. /etc/fstab
- B. /etc/resolv.conf and the resolver service
- C. /etc/sudoers
- D. /etc/audit/audit.rules
Show answer
Answer: B
Reaching the gateway by IP shows that the interface, address and routing work, so the problem is name resolution. The resolver configuration, such as /etc/resolv.conf or systemd-resolved, is the first place to look. fstab concerns mounts, sudoers concerns privilege escalation, and the audit rules do not affect name lookups.
Want more questions like this? Full XK0-006 practice tests →
Keep going
The 20-question practice test gives a longer run, and the domain pages start with system management. A weak spot can be placed in the study plan.