2 of 2

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 -k
  • findmnt --verify
  • systemctl is-enabled
  • systemctl is-active
  • mount -a
  • sudo -l
  • reboot
  • systemctl --failed

45 min5 exercises

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:

AreaVerify with
Users, UID, shellid NAME, getent passwd NAME
sudosudo -l -U NAME, visudo -c
Password agingchage -l NAME
Group directoryls -ld DIR, getfacl DIR
cron / atcrontab -l -u NAME, atq
Timersystemctl list-timers --no-pager
Time clientchronyc sources, timedatectl
Repositoriesdnf repolist, dnf install -y PKG
Flatpakflatpak remotes, flatpak list
Services, targetsystemctl is-enabled S, is-active S, get-default
Journaljournalctl --list-boots, ls /var/log/journal
tunedtuned-adm active, tuned-adm verify
Priorityps -o pid,ni,comm -p PID
Storagelsblk -f, vgs, lvs, findmnt, swapon --show
fstabmount -a, findmnt --verify
NFS, autofsfindmnt -t nfs4, automount -m, ls /mount/key
Networkip -br addr, nmcli -g ipv4.method con show NAME, hostnamectl
Firewallfirewall-cmd --list-all (and --permanent --list-all)
SSHssh -o PreferredAuthentications=publickey node2 true, sshd -T
SELinuxgetenforce, 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 startsystemctl enable (or enable --now)
firewall-cmd ...firewall-cmd --permanent ... + reload
setsebool NAME onsetsebool -P NAME on
setenforce 0SELINUX= in /etc/selinux/config
mount DEVICE DIRline in /etc/fstab
hostname NAMEhostnamectl set-hostname NAME
ip addr add ...nmcli connection modify ... && up
chconsemanage fcontext + restorecon
swaponline in /etc/fstab
tuned-adm profileneeds tuned enabled
editing /etc/resolv.confnmcli ... 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 fileCheck before leaving it
/etc/fstabmount -a, findmnt --verify
/etc/sudoers.d/*visudo -c
/etc/ssh/sshd_config.d/*sshd -t
/etc/httpd/conf.d/*apachectl configtest
/etc/exportsexportfs -ra
/etc/auto.*automount -m after reload
.repo filesdnf 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.

  1. Warm-up

    Turn a task into checks

    Take this task: "Create a 300 MiB logical volume lvdata in volume group vgapp with 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
  2. 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)
  3. 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_connect prints --> 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
  4. 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, setsebool without -P, systemctl start without enable, setenforce instead of the config file, mount instead of fstab, hostname instead of hostnamectl.

    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
  5. 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.