nerdexam
CompTIA

XK0-004 · Question #154

Joe, a user, reports that he is no longer able to write files to his home directory. Upon inspection, the Linux administrator discovers that attempting to create a new file gives the following error:

The correct answer is C. df -i. A 'No space left on device' error on a non-full disk indicates inode exhaustion - all available inodes are consumed even though disk blocks remain free. df -i reveals inode usage per filesystem to confirm this.

Troubleshooting and Diagnostics

Question

Joe, a user, reports that he is no longer able to write files to his home directory. Upon inspection, the Linux administrator discovers that attempting to create a new file gives the following error: No space left on . However, the disk and partition are not full. Which of the following commands would be BEST for device the administrator to use to continue troubleshooting this problem?

Options

  • Arm -Rf ~/.*
  • Bfsck -y /dev/sda1
  • Cdf -i
  • Dfdisk /dev/sda

How the community answered

(45 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    82% (37)
  • D
    11% (5)

Why each option

A 'No space left on device' error on a non-full disk indicates inode exhaustion - all available inodes are consumed even though disk blocks remain free. df -i reveals inode usage per filesystem to confirm this.

Arm -Rf ~/.*

rm -Rf ~/.* forcibly deletes all hidden files and directories in the home directory, which is a destructive action that addresses disk block usage rather than inode exhaustion, and should not be used before the root cause has been confirmed.

Bfsck -y /dev/sda1

fsck -y /dev/sda1 performs a filesystem consistency check with automatic repair, but it must not be run on a currently mounted filesystem and is inappropriate as an initial troubleshooting step when inode exhaustion - not filesystem corruption - is the likely cause.

Cdf -iCorrect

df -i displays inode statistics for each mounted filesystem including total inodes, used inodes, free inodes, and percentage used - this directly identifies inode exhaustion as the root cause when disk block usage is normal, and is the appropriate next troubleshooting step given the symptoms described.

Dfdisk /dev/sda

fdisk /dev/sda is a partition management utility for creating, deleting, and resizing disk partitions, and is entirely unrelated to diagnosing or resolving a 'no space left on device' error caused by inode exhaustion.

Concept tested: Diagnosing inode exhaustion using df -i

Source: https://man7.org/linux/man-pages/man1/df.1.html

Topics

#inodes#df -i#inode exhaustion#filesystem troubleshooting

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice