LPIC-1 Administrative Tasks Practice Question
A server has a backup script that runs daily at midnight. The system administrator notices that the script sometimes fails because the filesystem is mounted read-only. Which approach is the best practice to ensure the script runs only when the filesystem is writable?
⚠ Common exam trap
Many candidates assume remounting (Option A) is a safe fix, but LPIC-1 emphasizes that a read-only filesystem often indicates a deeper problem, and the best practice is to check state rather than force a change.
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
✓
Wrap the backup command in a script that checks if the filesystem is writable before proceeding
It implements a proactive check within the script itself, using a command like `touch /mountpoint/testfile 2>/dev/null` or checking `/proc/mounts` to verify write access before executing the backup. This avoids unnecessary remounts and ensures the script only proceeds when the filesystem is writable, which is a robust and self-contained solution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add a cron job that runs before the backup to remount the filesystem read-write
Why it's wrong here
Risk of remounting a filesystem that should remain read-only.
- ✗
Use anacron to run the job after boot
Why it's wrong here
Anacron runs after boot but does not check filesystem state.
- ✓
Wrap the backup command in a script that checks if the filesystem is writable before proceeding
Why this is correct
Best practice: check condition inside script and exit gracefully if not met.
- ✗
Change the cron job to run every hour until it succeeds
Why it's wrong here
Does not address the root cause; may cause repeated failures.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 527 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 →
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.