nerdexam
CompTIA

XK0-005 · Question #46

A technical support engineer receives a ticket from a user who is trying to create a 1KB file in the /tmp directory and is getting the following error No space left on device. The support engineer…

The correct answer is C. the filesystem ran out of inodes. Despite having ample disk space, the "No space left on device" error when creating a small file indicates that the filesystem has run out of inodes, which are necessary metadata structures for each file.

Troubleshooting

Question

A technical support engineer receives a ticket from a user who is trying to create a 1KB file in the /tmp directory and is getting the following error No space left on device. The support engineer checks the /tmp directory, and it has 20GB of free space. Which of the following BEST describes a possible cause for this error?

Options

  • AThe /tmp directory is not mounted.
  • BThe filesystem is formatted with a 4MB block size.
  • Cthe filesystem ran out of inodes.
  • DThe /tmp directory has been set with an immutable attribute.

How the community answered

(52 responses)
  • A
    12% (6)
  • B
    4% (2)
  • C
    79% (41)
  • D
    6% (3)

Why each option

Despite having ample disk space, the "No space left on device" error when creating a small file indicates that the filesystem has run out of inodes, which are necessary metadata structures for each file.

AThe /tmp directory is not mounted.

If `/tmp` were not mounted, creating a file would attempt to use the underlying root filesystem, and the error message would likely still point to an inode or block space issue on that filesystem, not specifically indicate unmounted status.

BThe filesystem is formatted with a 4MB block size.

While a 4MB block size would lead to inefficient storage for a 1KB file (consuming 4MB), it would not prevent the file's creation if both free disk space and inodes are available; the error message is specific to lacking "space."

Cthe filesystem ran out of inodes.Correct

The "No space left on device" error, despite having free disk space, strongly indicates that the filesystem has exhausted its available inodes. Inodes store metadata for files and directories, and each new file or directory requires one, so running out of them prevents new file creation even if data blocks are abundant.

DThe /tmp directory has been set with an immutable attribute.

An immutable attribute (e.g., set with `chattr +i`) prevents modification or deletion of a file or directory, but it would not typically result in a "No space left on device" error when trying to *create* a new file.

Concept tested: Filesystem inodes exhaustion

Source: https://www.redhat.com/sysadmin/troubleshoot-inodes-linux

Topics

#Filesystem#Inodes#Troubleshooting#Disk Space

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice