LFCA 2.4: Troubleshooting
A full filesystem, a web server that won't start, DNS, load, and a boot that stops in emergency mode.
Before you start
Work as root (sudo -i). Answers go in /root/lab-answers/<task>.
The lab adds a 1 GiB spare disk with a filesystem mounted at /data and
fills most of it with one large file, as if you had run fallocate there.
The mount lasts until the next reboot. It installs nginx if it's missing
and puts a typo in /etc/nginx/nginx.conf, so nginx fails to start. Reset
puts nginx back as it was.
Tasks
/datais nearly full. Find what fills it withdfanddu, as if you didn't know, and write the full path of the large file to/root/lab-answers/1.- nginx won't start. Find the error with
systemctl status,journalctl -u nginxandnginx -t, fix it, and get nginx running (and starting at boot) again. - Put a wrong DNS server in the VM's network settings and diagnose the
symptoms with
pinganddig. Put it back. Not graded. - Install
stress-ng, runstress-ng --cpu 2 --timeout 60(oryes > /dev/null) and watch the load average intop. Not graded. - Give root a password, add a bad line to
/etc/fstab, reboot, and recover from emergency mode. Do this only at the VM's console, and take a snapshot first. Not graded: the VM booting normally again is your check.
Hints
df -h, thendu -xh --max-depth=1 /data | sort -h, one level deeper each time;du -aalso shows files, andls -lashows hidden ones.nginx -tnames the file and line.systemctl restart nginx,systemctl enable nginx,curl -s localhost | head.resolvectl dnson Ubuntu;nmcli connection modify ... ipv4.dnson the RHEL family.stress-ngis in the RHEL family's AppStream and Ubuntu's universe.- In emergency mode,
mount -o remount,rw /, fix/etc/fstab,systemctl daemon-reload,mount -a, thenreboot.