**Overview**Below are five+ plausible root causes for a stateful service failing health checks, with a concise diagnostic check or command to help distinguish disk I/O problems from application-logic failures. I frame each as: cause → quick check (what indicates disk I/O vs app logic).1) Disk full / no free inodes - Check: free space and inodes bash
df -h /var/lib/myservice && df -i /var/lib/myservice
- Disk I/O signal: 0B available or 100% inodes. - App logic signal: space OK but app logs show write errors or panics.2) Underlying device errors (hardware / SMART) - Check: kernel/device errors and SMART health bash
dmesg | egrep -i 'ext4|sd|error|I/O' -n && smartctl -H /dev/sda
- Disk I/O signal: repeated I/O errors, SMART FAIL. - App logic signal: no kernel I/O errors; failures appear only in app stack traces.3) High disk latency / saturated IOPS - Check: realtime I/O stats and top consumers bash
iostat -xz 1 3 && iotop -b -n 5
- Disk I/O signal: high await/svctm, %util near 100, io-consuming processes. - App logic signal: normal I/O metrics but service process CPU/thread stuck or exceptions.4) Filesystem corruption / mount read-only - Check: mount status and attempts to write a temp file bash
mount | grep '/var/lib/myservice' && touch /var/lib/myservice/.healthcheck_write 2>&1 || echo fail
- Disk I/O signal: filesystem mounted ro or write fails with I/O errors. - App logic signal: writes succeed but app still reports unhealthy.5) Permission / ownership issues on storage path - Check: ownership/SELinux and ability to open files as service user bash
ls -ld /var/lib/myservice && sudo -u myservice_user test -w /var/lib/myservice && echo write-ok
- Disk I/O signal: permissions prevent write but disk health metrics normal. - App logic signal: permissions correct; failures in app logs (exceptions, config errors).6) Network-mounted volume (NFS/EBS) problems - Check: show mount type, latency, and rpc stats bash
mount | grep myvolume && cat /proc/mounts && showmount -e nfs-server 2>/dev/null
- Disk I/O signal: NFS hangs, retransmits, or remote unreachability. - App logic signal: mount healthy locally; application stack traces point to logic.7) Application-level bug (corrupt DB, crash loops) - Check: service logs, open files and sockets bash
journalctl -u myservice -n 200 && lsof -p $(pidof myservice)
- Disk I/O signal: logs show I/O exceptions; system metrics align with disk faults. - App logic signal: clear stack trace, assertions, config errors without underlying I/O errors.Tips: correlate timestamps (dmesg/iostat) with service log timestamps to decide root cause quickly.