Courseiva
Storage Management →mediumMultiple Select

LFCS Storage Management Practice Question

Which TWO of the following are valid ways to mount a filesystem with the 'noexec' option to prevent execution of binaries?

⚠ Common exam trap

Candidates often confuse the 'defaults' option in fstab with a safe or neutral setting, not realizing that 'defaults' implicitly includes 'exec', so they incorrectly select option C as a valid way to prevent execution.

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

✓

mount -o noexec /dev/sdb1 /mnt/data

Option A is correct because the mount command's -o flag accepts the noexec mount option directly, so 'mount -o noexec /dev/sdb1 /mnt/data' mounts the device /dev/sdb1 at /mnt/data with binary execution disabled. Option E is correct because the fourth field of an /etc/fstab entry holds the mount options, so adding 'noexec' there (e.g., 'defaults,noexec') makes the filesystem mount with noexec persistently at boot or on 'mount -a'. Option B is wrong because 'exec' is the opposite of noexec and explicitly permits execution. Option C is wrong because 'defaults' expands to rw,suid,dev,exec,auto,nouser,async, which includes exec and thus allows binaries to run. Option D is wrong because 'mount --bind' merely mirrors one directory tree onto another and does not itself set the noexec option.

Answer analysis

Option-by-option breakdown

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

  • ✓

    mount -o noexec /dev/sdb1 /mnt/data

    Why this is correct

    The mount command's -o flag passes the noexec mount option alongside the device and target directory, applying it for that mount session. This satisfies the requirement to mount a filesystem with binary execution disabled without editing persistent configuration.

  • ✗

    Add 'exec' to the fourth field of /etc/fstab for the entry.

    Why it's wrong here

    The exec flag explicitly permits binary execution, directly contradicting the noexec requirement. It is tempting because exec is the default and is the correct entry when a filesystem must allow scripts and programs to run, such as a shared application directory where administrators have deliberately removed a prior noexec restriction.

  • ✗

    Add 'defaults' to the fourth field of /etc/fstab for the entry.

    Why it's wrong here

    The defaults keyword expands to rw, suid, dev, exec, auto, nouser and async, so it enables exec rather than disabling it. It is tempting because defaults is the conventional fstab value for ordinary data volumes, and would be correct when no execution restriction is required on that mount point.

  • ✗

    mount --bind /mnt/data1 /mnt/data2

    Why it's wrong here

    The --bind flag creates a second mount of an existing tree at a new location; it copies the source mount's flags and offers no mechanism to add noexec, so binaries remain executable. It is tempting because bind mounts are the standard way to expose a directory elsewhere, which would be correct when the goal is path redirection rather than restricting execution.

  • ✓

    Add 'noexec' to the fourth field of /etc/fstab for the entry.

    Why this is correct

    The fourth field of an /etc/fstab entry holds the mount options list, so appending noexec there applies it at every boot. This satisfies the persistent mounting requirement, complementing the runtime mount -o approach without invoking the mount command directly.

About these practice questions

Courseiva writes every LFCS question from scratch — 406 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.