Exam TechniqueLesson 2 of 2
Working a practical exam: order, verification and persistence
Read tasks as a grader would, choose an order, verify each result with a one-liner, and prove everything survives a reboot.
man -kfindmnt --verifysystemctl is-enabledsystemctl is-activemount -asudo -lrebootsystemctl --failed
After this lesson you can
- Turn each task into the facts a grader would check, and write a one-line verification for each.
- Order a task list to save time: dependencies first, reboots batched, quick wins early.
- Use a final reboot-and-check pass to catch every setting that was only temporary.
The idea
Passing is less about knowing more commands and more about not losing marks you have already earned. Four habits do most of the work.
1. Read the task as a grader
Every number, name, path and adjective in the task is probably a check. “Create a 300 MiB logical volume lvdata in vgapp with 16 MiB extents, XFS, mounted persistently on /srv/data” contains: the VG name, the PE size, the LV name, the size, the file system type, the mount point, and the word persistently (an /etc/fstab line, and the mount present after a reboot). Underline them before you type anything. If a value is given (a UID, a password, a port, a path), use it exactly; if the task says approximately, a small rounding is expected.
2. Do them in a sensible order
- Read all the tasks first. Spend the first minutes mapping dependencies.
- Prerequisites first: repositories before installing packages, users before shared directories or NFS homes, packages before their services.
- Batch reboots. Do the reboot-requiring task (root password recovery, kernel argument) early on one machine while you work on the other.
- Bank the quick wins, then do the long ones. Do not spend 30 minutes on one 8-point task.
- Skip and return: if a task is not working after about one-and-a-half times its expected time, note it and move on.
3. Verify each task right after doing it
A verification is a command that prints the answer. The grader will run something similar, so run it yourself. A pocket reference by objective:
| Area | Verify with |
|---|---|
| Users, UID, shell | id NAME, getent passwd NAME |
| sudo | sudo -l -U NAME, visudo -c |
| Password aging | chage -l NAME |
| Group directory | ls -ld DIR, getfacl DIR |
| cron / at | crontab -l -u NAME, atq |
| Timer | systemctl list-timers --no-pager |
| Time client | chronyc sources, timedatectl |
| Repositories | dnf repolist, dnf install -y PKG |
| Flatpak | flatpak remotes, flatpak list |
| Services, target | systemctl is-enabled S, is-active S, get-default |
| Journal | journalctl --list-boots, ls /var/log/journal |
| tuned | tuned-adm active, tuned-adm verify |
| Priority | ps -o pid,ni,comm -p PID |
| Storage | lsblk -f, vgs, lvs, findmnt, swapon --show |
| fstab | mount -a, findmnt --verify |
| NFS, autofs | findmnt -t nfs4, automount -m, ls /mount/key |
| Network | ip -br addr, nmcli -g ipv4.method con show NAME, hostnamectl |
| Firewall | firewall-cmd --list-all (and --permanent --list-all) |
| SSH | ssh -o PreferredAuthentications=publickey node2 true, sshd -T |
| SELinux | getenforce, ls -Zd, `semanage port -l |
4. Persistence: the reboot rule
The most common way to lose marks is a setting that works now and disappears at reboot. The exam grader reboots (or inspects the configuration files), so anything not stored on disk is lost. The pairs to remember:
| Runtime only (lost) | Persistent (kept) |
|---|---|
systemctl start | systemctl enable (or enable --now) |
firewall-cmd ... | firewall-cmd --permanent ... + reload |
setsebool NAME on | setsebool -P NAME on |
setenforce 0 | SELINUX= in /etc/selinux/config |
mount DEVICE DIR | line in /etc/fstab |
hostname NAME | hostnamectl set-hostname NAME |
ip addr add ... | nmcli connection modify ... && up |
chcon | semanage fcontext + restorecon |
swapon | line in /etc/fstab |
tuned-adm profile | needs tuned enabled |
editing /etc/resolv.conf | nmcli ... ipv4.dns |
The last ten minutes of the exam belong to the final pass: mount -a, findmnt --verify, systemctl --failed, reboot, then go through your verification card on both machines.
Try it
sudo vgs -o vg_name,vg_extent_size
sudo lvs -o lv_name,lv_size
findmnt /srv/data
grep /srv/data /etc/fstab
VG Ext
vgapp 16.00m
LV LSize
lvdata 304.00m
TARGET SOURCE FSTYPE OPTIONS
/srv/data /dev/mapper/vgapp-lvdata xfs rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota
/dev/mapper/vgapp-lvdata /srv/data xfs defaults 0 0
Every noun in the task is visible in these four outputs: VG and extent size, LV name and size (304 MiB is 300 MiB rounded up to 19 extents, which satisfies “300 MiB”), file system type, mount point, and the persistent fstab line.
Safe editing
You have no snapshot in the real exam, so make mistakes recoverable:
sudo cp -a /etc/fstab /etc/fstab.bak
sudo vi /etc/fstab
sudo mount -a && sudo findmnt --verify
| Edited file | Check before leaving it |
|---|---|
/etc/fstab | mount -a, findmnt --verify |
/etc/sudoers.d/* | visudo -c |
/etc/ssh/sshd_config.d/* | sshd -t |
/etc/httpd/conf.d/* | apachectl configtest |
/etc/exports | exportfs -ra |
/etc/auto.* | automount -m after reload |
.repo files | dnf repolist |
The final pass
sudo mount -a && sudo findmnt --verify
systemctl --failed --no-pager
getenforce
sudo reboot
After the reboot, run through the verification card, starting with the objectives that involve services (they depend on enable) and storage (they depend on fstab). A failed unit shown by systemctl --failed is a gift: it points straight at what is broken.
Going further
Make your own list of the five tasks you find slowest and drill them until they take half the time. Practise typing commands, not pasting: in the exam you cannot paste from notes. Learn the shortcuts that matter: Ctrl+R history search, !$ (last argument), Tab completion for commands, paths and even systemctl unit names, and man -k + /pattern in a manual page. Documentation under /usr/share/doc (ls /usr/share/doc | grep -i nfs) often contains complete example configuration files that are faster than writing from memory. Finally, rest the night before. Fatigue causes more lost points than missing knowledge.
Practice
0 of 5 done
Do these on your own system. They get harder. Check each result, then tick it off.
- Warm-up
Turn a task into checks
Take this task: "Create a 300 MiB logical volume
lvdatain volume groupvgappwith 16 MiB extents, format it XFS, and mount it persistently on/srv/data." List every fact a grader could check (at least six) and the command that shows each.Check your result
Facts: partition/PV exists, VG name and PE size 16 MiB, LV name and size about 300 MiB, file system type XFS, mount point
/srv/data, persistent entry in/etc/fstab, mounted after reboot. Commands:pvs,vgs -o +vg_extent_size,lvs,lsblk -f,findmnt,grep data /etc/fstab.Hint
For each noun and number in the task there is a check. For each word like "persistent" there is a reboot check.
Solution
sudo pvs sudo vgs -o vg_name,vg_extent_size sudo lvs -o lv_name,lv_size lsblk -f findmnt /srv/data grep /srv/data /etc/fstab sudo findmnt --verify - Practice
Choose an order
You are given these tasks: (1) reset the root password of node2 (needs a reboot); (2) set up NFS autofs for home directories; (3) create users with a shared group; (4) write a script; (5) configure repositories; (6) install packages; (7) extend a logical volume; (8) SELinux web server on a new port. Number them in the order you would do them and say why for each early choice.
Check your result
A sound answer puts repositories before package installs, users before shared-directory permissions and NFS homes, the reboot task early or batched, and leaves the most complex task (SELinux web) for when basics are secure.
Hint
Prerequisites first (repos before installs, groups before permissions), batch reboots, bank easy points early, keep a time reserve for the hard one.
Solution
1. Repositories (everything else installs from them) 2. Install packages (httpd, autofs, nfs-utils, tuned, ...) 3. Users and groups (needed by permissions and autofs) 4. Reset root password on node2 (reboot node2 while node1 work continues) 5. LVM extend (short, deterministic) 6. Script (short, deterministic) 7. NFS/autofs homes (depends on users and node2 being back) 8. SELinux web server on a new port (longest, depends on packages, firewall) - Practice
Write your own verification cards
For each objective area write one command (or two) that proves a task is done: users and sudo, password aging, cron, a systemd timer, tuned, default target, NFS mount, autofs, firewall rule, SSH key login, SELinux file context, SELinux port, SELinux boolean, swap, repository, Flatpak. Use the table in this lesson as a model.
Check your result
A page of commands where each prints a clear yes/no or the value asked for, e.g.
getsebool httpd_can_network_connectprints--> on.Hint
Prefer commands whose output states the answer:
is-enabled,get-default,-l,--list-*,getsebool,findmnt.Solution
sudo -l -U harry; chage -l harry; crontab -l -u natasha systemctl list-timers report.timer --no-pager tuned-adm active; systemctl get-default findmnt -t nfs4; automount -m | head firewall-cmd --list-all; ssh -o PreferredAuthentications=publickey node2 true ls -Zd /srv/web; semanage port -l | grep 8081; getsebool -a | grep httpd_enable swapon --show; dnf repolist; flatpak list - Practice
The final reboot
On your lab, after configuring a few things (a mount, a service, a firewall rule, a SELinux boolean, a kernel argument), run the end-of-exam procedure:
mount -a,findmnt --verify, a reboot, then a check that each setting is still in force. Write down what you found that did not survive.Check your result
Everything configured with persistence flags (
--permanent,-P,enable, fstab, config files) is present after the reboot. Anything done at runtime only is missing.Hint
The usual failures: firewalld without
--permanent,setseboolwithout-P,systemctl startwithoutenable,setenforceinstead of the config file,mountinstead of fstab,hostnameinstead ofhostnamectl.Solution
sudo mount -a && sudo findmnt --verify systemctl --failed --no-pager sudo reboot # after the reboot findmnt /srv/data; systemctl is-enabled httpd; firewall-cmd --list-all getsebool httpd_can_network_connect; cat /proc/cmdline - Challenge
Time budget and a recovery plan
For a 3-hour practice exam with about 23 tasks, write a budget: time for reading all tasks, per-task limit, a rule for when to skip a task, a reserve for the final reboot and verification, and what you do if a task breaks something that other tasks need (for example a bad
/etc/fstab).Check your result
A concrete plan with numbers: e.g. 10 min to read, ~6 min per task, skip at 1.5× budget, 15 min reserve, snapshots impossible in the exam so edit carefully and keep a backup copy of each file you change.
Hint
You cannot snapshot in the real exam. Copy a file before you edit it (
cp -a file file.bak) and always run the checking command (mount -a,sshd -t,visudo -c) before leaving the file.Solution
0:00-0:10 read every task; mark easy / hard / needs-reboot 0:10-2:30 work in dependency order; skip any task that passes 1.5x its time 2:30-2:45 return to skipped tasks 2:45-3:00 reboot, run the verification card, fix what did not persist Safety: cp -a before edits; mount -a / sshd -t / visudo -c / findmnt --verify after.