CompTIA Linux+ (XK0-004) — Question 253
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 device. However, the disk and partition are not full. Which of the following commands would be BEST for the administrator to use to continue troubleshooting this problem?
Answer options
- A. rm -Rf ~/.*
- B. fsck -y /dev/sda1
- C. df -i
- D. fdisk /dev/sda
Correct answer: C
Explanation
The correct answer is C because the 'df -i' command checks the inode usage, which can reveal if the filesystem has run out of inodes, preventing file creation despite disk space being available. Option A, 'rm -Rf ~/. *', would delete files rather than troubleshoot, B, 'fsck -y /dev/sda1', is for filesystem checks but not specifically for this issue, and D, 'fdisk /dev/sda', is for partition management and not relevant to the problem at hand.