Courseiva

LPIC-1 Devices, Filesystems and FHS Practice Question

Exhibit

$ mount | grep /dev/sdb1
/dev/sdb1 on /mnt/data type ext4 (rw,noexec,nosuid,nodev)
$ ls -l /mnt/data/script.sh
-rwxr-xr-x 1 root root 100 Jan 1 00:00 /mnt/data/script.sh
$ /mnt/data/script.sh
bash: /mnt/data/script.sh: Permission denied

Refer to the exhibit. A user tries to execute a script on a mounted filesystem but gets a permission denied error. The script has execute permissions. What is the most likely cause?

⚠ Common exam trap

Watch out — candidates often assume 'permission denied' always means incorrect file permissions, but the LPIC-1 exam tests the understanding that mount options like 'noexec' can override file-level permissions and cause execution failures.

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 filesystem is mounted with the 'noexec' option.

The 'noexec' mount option prevents execution of any binary or script on the filesystem, regardless of file permissions. Even if the script has execute permissions set, the kernel will refuse to execute it when the filesystem is mounted with 'noexec'. This is a common security measure on filesystems like /tmp or /home to prevent unauthorized code execution.

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 script is not executable for the user.

    Why it's wrong here

    The script has execute permissions for all, so this is not the issue.

  • ✗

    The user does not have read permission on the script.

    Why it's wrong here

    Without read permission the kernel cannot open the script file to interpret it, so execve fails with EACCES even though the execute bit is set. Read permission is genuinely required for shell scripts, but this option ignores the exhibit, which already shows the execute bit present; the stem's scenario hinges on the mount's noexec flag instead.

  • ✓

    The filesystem is mounted with the 'noexec' option.

    Why this is correct

    The `noexec` mount option instructs the kernel to refuse execution of any binary or script residing on that filesystem, regardless of the file's own execute permission bits. Since the script already has execute permissions, the mount-level restriction is the only remaining cause of the permission denied error.

  • ✗

    The filesystem is full.

    Why it's wrong here

    A full filesystem yields ENOSPC write failures, not permission denied on execute. The likely cause is a noexec mount option, which blocks execution regardless of file mode bits. Checking free space is tempting because disk exhaustion breaks writes, but it does not produce this error.

About these practice questions

This LPIC-1 question is part of Courseiva's 402-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 LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.