nerdexam
Linux_Foundation

LFCS · Question #722

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

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.

How the community answered

(40 responses)
  • A
    3% (1)
  • C
    3% (1)
  • E
    95% (38)

Why each option

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

AThe source file is hidden.

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.

BThe source file is read-only.

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.

CThe source file is a shell script.

The type of file, such as a shell script, does not impose restrictions on creating hard links to it.

DThe source file is already a hard link.

A file can have multiple hard links pointing to it; being an existing hard link does not prevent the creation of additional hard links.

EThe source and the target are on different filesystems.Correct

Hard links operate by pointing directly to a file's inode number. Since inode numbers are unique only within a single filesystem, a hard link cannot refer to an inode on a different filesystem, thus attempting to do so will result in an error.

Concept tested: Hard link limitations across filesystems

Source: 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 Practice