nerdexam
Linux_Foundation

LFCS · Question #792

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?

The correct answer is E. The source and the target are on different filesystems. Creating a hard link to an ordinary file will fail if the source file and the target link are located on different filesystems.

Submitted by naveen.iyer· Apr 18, 2026Storage Management

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.

How the community answered

(45 responses)
  • A
    2% (1)
  • C
    2% (1)
  • D
    4% (2)
  • E
    91% (41)

Why each option

Creating a hard link to an ordinary file will fail if the source file and the target link are located on different filesystems.

AThe source file is hidden.

The hidden status (indicated by a leading dot) of a file does not prevent the creation of a hard link.

BThe source file is read-only.

A read-only source file does not prevent the creation of a hard link, as hard linking only creates a new directory entry pointing to the existing inode.

CThe source file is a shell script.

The type of file content, such as a shell script, has no bearing on whether a hard link can be created.

DThe administrator does not own the source file.

File ownership is not a strict requirement for creating a hard link, as long as the user has appropriate permissions (e.g., write permission in the target directory).

EThe source and the target are on different filesystems.Correct

Hard links function by referencing the same inode number, which are unique only within a single filesystem. Therefore, a hard link cannot span across multiple distinct filesystems.

Concept tested: Hard link filesystem limitations

Source: https://www.gnu.org/software/coreutils/manual/html_node/ln-invocation.html

Topics

#Hard Links#Filesystems#Inodes#ln command

Community Discussion

No community discussion yet for this question.

Full LFCS Practice