Courseiva
System Management →mediumMultiple Select

XK0-006 System Management Practice Question

A user wants to create a hard link to a file. Which three conditions must be true for a hard link to be created successfully? (Choose three.)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The source and link must be on the same filesystem.

Option C is correct because a hard link is simply a directory entry that points to the same inode, and inode numbers are only unique within a single filesystem, so the source and the new link must reside on the same filesystem (e.g., both under the same mount point). Option D is correct because hard links to directories are prohibited on Linux/Unix to prevent cycles in the directory tree, so the source must be a regular file (or another non-directory file type). Option E is correct because the link() system call requires an existing source pathname to resolve to an inode; you cannot create a hard link to a file that does not exist. Option A is not required since the SUID bit is a permission attribute unrelated to link creation, and Option B is wrong because a hard link may have any name and is not required to match the source filename.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The source file must have the SUID bit set.

    Why it's wrong here

    The SUID bit governs execution privilege escalation, not link creation; it is unrelated to directory entries. Hard links require the source and link on the same filesystem, with the source existing and the user holding write permission in the target directory. SUID would matter for running a program as its owner.

  • ✗

    The link must have the same name as the source.

    Why it's wrong here

    A hard link is a new directory entry that may carry any unused name; it need not match the source filename. The real constraints are same filesystem, existing source, and directory write permission. Identical naming applies to neither hard nor symbolic links, so this condition is simply false.

  • ✓

    The source and link must be on the same filesystem.

    Why this is correct

    Hard links are directory entries pointing to the same inode, and inode numbers are unique only within a single filesystem. Cross-filesystem linking is therefore impossible, so source and link must reside on the same mounted filesystem.

  • ✓

    The source file must be a regular file, not a directory.

    Why this is correct

    Hard links cannot be created to directories, since doing so would introduce cycles into the directory tree and break filesystem traversal. The source must therefore be a regular file, not a directory, for the link to succeed.

  • ✓

    The source file must exist.

    Why this is correct

    A hard link is a new directory entry referencing an existing inode, so the inode must already be allocated. If the source file does not exist, there is no inode to reference and the link call fails with ENOENT.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.