Interview Prep/Linux/Boot, time, cron and kernel

After a power outage, the server boots but `/var` is mounted read-only and `dmesg` shows `EXT4-fs (dm-2): warning: mounting fs with errors, running e2fsck is recommended`.

AdvancedTroubleshootingBoot, time, cron and kernel
Answer

Likely causes → Unclean shutdown left inconsistencies the journal couldn't resolve; ext4 detected errors.

Diagnose →

sudo tune2fs -l /dev/mapper/vg0-var | grep -Ei 'state|errors'
findmnt /var
dmesg -T | grep EXT4

Fix → Boot into rescue or emergency mode so /var isn't in use (systemctl rescue), unmount it, run e2fsck -f /dev/mapper/vg0-var, then reboot. Take a snapshot first if the data matters.

Prevent → UPS, storage with battery-backed cache, and monitoring of filesystem error state.

All Linux questions Roadmap: Linux

More on Boot, time, cron and kernel