nerdexam
CompTIA

XK0-004 · 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 che

The correct answer is C. the filesystem ran out of inodes.. The 'No space left on device' error can occur even with available disk space when the filesystem has exhausted its inode table, preventing creation of new files or directories.

Troubleshooting and Diagnostics

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

(38 responses)
  • A
    8% (3)
  • B
    5% (2)
  • C
    68% (26)
  • D
    18% (7)

Why each option

The 'No space left on device' error can occur even with available disk space when the filesystem has exhausted its inode table, preventing creation of new files or directories.

AThe /tmp directory is not mounted.

If /tmp were not mounted, attempting to write to it would fail with a path resolution or mount-related error, not 'No space left on device', and the 20GB free space observation would be irrelevant.

BThe filesystem is formatted with a 4MB block size.

A 4MB block size causes internal fragmentation and wastes space for small files, but with 20GB of reported free space remaining the filesystem would still have allocatable blocks and would not trigger a no-space error for a 1KB file.

Cthe filesystem ran out of inodes.Correct

Every file, including a 1KB file, requires one inode entry to store metadata such as permissions, ownership, and pointers to data blocks. When the inode count is exhausted on a filesystem, the kernel returns ENOSPC (no space left on device) even though data blocks are still available, because no inode can be allocated to represent the new file.

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

Setting the immutable attribute on a directory with chattr +i prevents modifications to that directory, but the resulting error is 'Operation not permitted' (EPERM), not 'No space left on device'.

Concept tested: Filesystem inode exhaustion causing ENOSPC error

Source: https://man7.org/linux/man-pages/man7/inode.7.html

Topics

#inodes#filesystem exhaustion#/tmp#disk space troubleshooting

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice