XK0-006 Troubleshooting Practice Question
A Linux administrator notices that a server's root filesystem is using 100% of its inodes, even though `df -h` shows only 60% of the disk space used. Users are unable to create new files. Which command most directly helps identify directories containing large numbers of small files that are consuming inodes?
⚠ Common exam trap
The trap here is assuming that disk-space tools like `df -h` or `du` will reveal an inode problem, when inode exhaustion is a separate resource that requires inode-aware commands such as `df -i` and `du --inodes`.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
du --inodes -s /* | sort -n
The root filesystem has run out of inodes, not blocks, so tools that report disk space are ineffective. `du --inodes -s /*` followed by numeric sorting reveals which top-level directories contain the most inodes, allowing the administrator to drill down and remove unneeded small files. This approach directly targets the exhausted resource and avoids wasted effort on block-space analysis.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
find / -xdev -type f | wc -l
Why it's wrong here
This pipeline counts every regular file on the root filesystem, giving a single total rather than identifying which directories hold the bulk of the inodes. While it confirms that many files exist, it provides no per-directory breakdown. The administrator needs to locate the specific directory tree consuming inodes, so a bare count across the whole filesystem does not narrow the search and wastes time on a large filesystem.
- ✗
du -sh /*
Why it's wrong here
`du -sh /*` reports disk space usage in human-readable form for top-level directories, not inode counts. It would show which directories consume the most blocks, but the scenario is about inode exhaustion, not block usage. A directory full of empty or tiny files would consume many inodes yet very little space, so `du` would not reveal the culprit and could mislead the administrator into investigating the wrong resource.
- ✓
du --inodes -s /* | sort -n
Why this is correct
`du --inodes -s /*` summarizes inode counts for each top-level directory, and `sort -n` orders them numerically so the largest consumer appears last. This directly addresses inode exhaustion by pinpointing which directory tree holds the most inodes. Unlike disk-space tools, it counts inodes regardless of file size, making it ideal for finding directories filled with many small or empty files that exhaust the inode table.
- ✗
df -i
Why it's wrong here
`df -i` displays inode usage statistics per mounted filesystem, confirming the exhaustion reported in the scenario. However, it only shows aggregate totals for each mount point, such as IUsed and IFree percentages. It cannot identify which subdirectory or file type is responsible for the high inode count. To find the offending directory, a tool that counts inodes per directory, such as `du --inodes`, is required instead.
Go deeper
Related to this question
About these practice questions
Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.