220-1102 Question 265
Single answerdfA Linux workstation user reports that saving files to the home directory fails with a "No space left on device" error. As a support technician, you want to quickly verify which mounted filesystem is full and how much space remains on each mount point. Which command should you use first?
- A
df -h
- B
du -sh /home
- C
fsck /home
- D
chmod 755 /home
Show answer and explanation
Correct answer: A
Explanation
This question tests practical Linux command-line troubleshooting relevant to A+ Core 2. When a user receives a "No space left on device" error, the best first step is to check mounted filesystem capacity with df, especially df -h for readable output. This helps determine whether the root filesystem, home partition, or another mount point is full. After identifying the affected filesystem, a technician might use du to locate large directories or files. This approach aligns with standard Linux administration best practices and the documented purpose of df in GNU coreutils and common Linux manual pages.
- A. Correct.
Correct. The df command reports filesystem disk space usage for mounted filesystems, and the -h option displays the results in a human-readable format such as MB or GB. In this scenario, it is the best first step because the technician needs to identify which filesystem is out of space and review available space across mounts.
- B. Incorrect.
Incorrect. The du command shows how much space specific directories and files consume, so du -sh /home can help identify large data within /home. However, it does not provide the best initial view of all mounted filesystems or confirm which filesystem is full. A technician would typically use df first, then du if further investigation is needed.
- C. Incorrect.
Incorrect. fsck is used to check and repair filesystem consistency issues, usually on unmounted filesystems or during maintenance. It is not the correct first tool for checking free disk space and could be disruptive if used unnecessarily.
- D. Incorrect.
Incorrect. chmod 755 /home changes permissions on the /home directory. Permission issues can prevent access, but they do not resolve or diagnose a "No space left on device" error. This option reflects a common mistake of confusing storage problems with permission problems.