nerdexam
Linux_FoundationLinux_Foundation

LFCS · Question #722

LFCS Question #722: Real Exam Question with Answer & Explanation

The correct answer is E: The source and the target are on different filesystems.. Hard links are constrained to a single filesystem because they reference inode numbers, which are unique identifiers only within a specific filesystem partition.

Submitted by kim_seoul· Apr 18, 2026Storage Management

Question

Creating a hard link to an ordinary file returns an error. What could be the reason for this?

Options

  • AThe source file is hidden.
  • BThe source file is read-only.
  • CThe source file is a shell script.
  • DThe source file is already a hard link.
  • EThe source and the target are on different filesystems.

Explanation

Hard links are constrained to a single filesystem because they reference inode numbers, which are unique identifiers only within a specific filesystem partition.

Common mistakes.

  • A. A file's hidden attribute does not prevent the creation of a hard link to it, as the link mechanism operates on the file's underlying inode.
  • B. A read-only file can still have hard links created to it, as creating a link only adds a directory entry pointing to the existing inode, without modifying the file's content or permissions.
  • C. The type of file, such as a shell script, does not impose restrictions on creating hard links to it.
  • D. A file can have multiple hard links pointing to it; being an existing hard link does not prevent the creation of additional hard links.

Concept tested. Hard link limitations across filesystems

Reference. https://man7.org/linux/man-pages/man2/link.2.html

Topics

#Hard links#Filesystems#Inodes#File linking limitations

Community Discussion

No community discussion yet for this question.

Full LFCS PracticeBrowse All LFCS Questions