XK0-005 · Question #795
An administrator has received multiple tickets relating to a lack of a disk space on a few servers, but the percentage of disk space usage is below the threshold. The following shows further…
The correct answer is A. find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n. When disk space issues arise despite low percentage usage, it often indicates an abundance of small files consuming inodes. The find command with -type f is used to count regular files, helping identify directories with an excessive number of files.
Question
An administrator has received multiple tickets relating to a lack of a disk space on a few servers, but the percentage of disk space usage is below the threshold. The following shows further analysis and findings:
Which of the following commands should the administrator use to help identify the issue?
Options
- Afind . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
- Bfind . -xdev -type p | cut -d "/" -f 2 | sort | uniq -c | sort -n
- Cfind . -xdev -type s | cut -d "/" -f 2 | sort | uniq -c | sort -n
- Dfind . -xdev -type d | cut -d "/" -f 2 | sort | uniq -c | sort -n
How the community answered
(23 responses)- A70% (16)
- B17% (4)
- C9% (2)
- D4% (1)
Why each option
When disk space issues arise despite low percentage usage, it often indicates an abundance of small files consuming inodes. The `find` command with `-type f` is used to count regular files, helping identify directories with an excessive number of files.
The issue of "lack of disk space" while "percentage of disk space usage is below the threshold" strongly suggests an inode exhaustion problem. The command `find . -xdev -type f` specifically lists all regular files within the current filesystem (`-xdev`), and the subsequent pipe counts and displays the number of regular files in each top-level directory, helping to pinpoint where the excessive number of files resides.
`-type p` refers to named pipes (FIFOs), which are typically not the cause of inode exhaustion on a large scale.
`-type s` refers to sockets, which are also unlikely to be the primary cause of widespread inode exhaustion.
`-type d` refers to directories, and while directories consume inodes, the issue described is more often due to a large number of regular files, not just directories themselves.
Concept tested: Linux filesystem troubleshooting, inode exhaustion, find command
Source: https://man7.org/linux/man-pages/man1/find.1.html
Topics
Community Discussion
No community discussion yet for this question.