nerdexam
ExamsLX0-103Questions#192
CompTIA

LX0-103 · Question #192

LX0-103 Question #192: Real Exam Question with Answer & Explanation

The correct answer is E. The source and the target are on different filesystems.. Hard links cannot span filesystem boundaries because they reference inodes, which are unique only within a single filesystem. This is the classic cause of an ln error for hard links.

Devices, Linux Filesystems, Filesystem Hierarchy Standard

Question

An administrator is trying to make a hard link to an ordinary file but ln returns an error. Which of the following could cause this?

Options

  • AThe source file is hidden.
  • BThe source file is read-only.
  • CThe source file is a shell script.
  • DThe administrator does not own the source file.
  • EThe source and the target are on different filesystems.

Explanation

Hard links cannot span filesystem boundaries because they reference inodes, which are unique only within a single filesystem. This is the classic cause of an ln error for hard links.

Common mistakes.

  • A. Hidden files (those with a leading dot in their name) are ordinary files on Linux and can be hard-linked without restriction; visibility status has no bearing on linking.
  • B. File permissions govern access to the file's content but do not prevent creation of additional hard links pointing to the file's inode.
  • C. Shell scripts are regular files and are fully eligible for hard links, just like any other non-directory file type.
  • D. Ownership of the source file is not required to create a hard link; what matters is having write permission in the directory where the new link entry will be created.

Concept tested. Hard link filesystem boundary restriction and inode scope

Reference. https://man7.org/linux/man-pages/man1/ln.1.html

Topics

#hard links#ln command#filesystem constraints#inodes

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice