nerdexam
CompTIA

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.

Troubleshooting

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)
  • A
    70% (16)
  • B
    17% (4)
  • C
    9% (2)
  • D
    4% (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.

Afind . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nCorrect

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.

Bfind . -xdev -type p | cut -d "/" -f 2 | sort | uniq -c | sort -n

`-type p` refers to named pipes (FIFOs), which are typically not the cause of inode exhaustion on a large scale.

Cfind . -xdev -type s | cut -d "/" -f 2 | sort | uniq -c | sort -n

`-type s` refers to sockets, which are also unlikely to be the primary cause of widespread inode exhaustion.

Dfind . -xdev -type d | cut -d "/" -f 2 | sort | uniq -c | sort -n

`-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

#Linux Commands#File System Utilities#Inode Management#Disk Space Diagnostics

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice