A disk-related outage often looks sudden only because the warning signs were scattered. A filesystem grows a little faster each week, a log rotation job stops working, inode use climbs while free gigabytes still look comfortable, or storage latency stretches database response times. Good disk risk monitoring for a server brings those signals together early enough for a safe response.
The goal is not to produce another page of storage metrics. It is to answer practical questions: Which filesystem could interrupt a service? How quickly is it approaching a limit? Is the device merely busy, or is it unhealthy? Is there enough time to clean up, resize, migrate, or repair without emergency work?
Disk risk is more than free-space percentage
A single percentage from df is useful, but it describes only one failure mode. Linux storage can become operationally unsafe because blocks are exhausted, inodes run out, a filesystem becomes read-only, the kernel reports I/O errors, latency rises, a thin-provisioned pool fills, or an application reaches a separate quota. A server can therefore have “free space” and still face a storage incident.
Context also changes the meaning of a threshold. A stable archive filesystem at 86% may have months of headroom. A database volume at 62% could be adding 20 GB per day and have less than a week before its operating limit. The second case deserves attention first even though its percentage is lower.
Map filesystems to services and business impact
Start by recording what each important mount supports. Include the application, owner, data type, backup method, recovery requirement, expected growth source, and the action available when capacity becomes tight. This turns an anonymous mount such as /dev/mapper/vg-data into an understood dependency such as “customer database data; resizing requires a storage change; keep at least 15% working headroom.”
- Root filesystem: package operations, temporary files, system logs, and service startup may fail when it fills.
- Database volume: writes, temporary tables, binary logs, and recovery can require substantial working space.
- Application data: uploads, generated files, caches, and queues may grow independently of the database.
- Backup destination: retention errors can silently consume capacity or cause new backups to fail.
- Container storage: images, writable layers, volumes, and logs can make the host fill unexpectedly.
Document exclusions as well. Ephemeral mounts, loop devices, read-only media, and intentionally full test volumes should not create noise. Exclusion rules should be specific and reviewed; broad filesystem-type filters can hide a real persistent volume.
Collect capacity, inode, and mount-state evidence
Use stable, machine-readable output and capture both byte and inode usage. Record total, used, available, percentage, filesystem, mount point, timestamp, hostname, and collector status. Keep the raw values in bytes so later calculations are not distorted by rounded display units.
# POSIX-style capacity output
LC_ALL=C df -P -x tmpfs -x devtmpfs
# Inode use catches millions-of-small-files failures
LC_ALL=C df -Pi -x tmpfs -x devtmpfs
# Filesystem type and mount options
findmnt --json --bytes
# Block devices and relationships
lsblk --json --bytes --output NAME,KNAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS
Treat collection failure as an unknown state, not as zero usage. If a mount disappears, a command times out, output cannot be parsed, or the newest sample is stale, report that condition prominently. Missing evidence can be the first sign of a storage or network-filesystem problem.
Measure growth to detect a full disk before failure
To detect a disk filling before failure, retain observations and calculate growth over useful windows. Daily samples are enough for many small servers; rapidly changing workloads may need hourly collection. Compare absolute bytes as well as percentages because filesystem resizing changes the denominator.
A simple forecast starts with recent growth:
daily_growth = (used_bytes_now - used_bytes_7_days_ago) / 7
usable_headroom = operating_limit_bytes - used_bytes_now
days_to_limit = usable_headroom / daily_growth
Use an operating limit rather than assuming 100% is safe. Databases, package upgrades, log rotation, snapshots, and incident diagnostics all need working room. Select a limit for each filesystem based on workload and recovery options—often 80–90%, but not as a universal rule.
Forecasts need safeguards. Ignore or label negative growth caused by cleanup. Require enough valid samples. Use a median or robust trend when backups and batch jobs cause spikes. Report confidence and recent volatility instead of presenting an exact date as certainty. “Likely to cross the operating limit in 9–14 days” is more honest than a precise timestamp based on noisy data.
Watch inodes and directories that grow unexpectedly
Inode exhaustion produces “no space left on device” even when capacity remains available. Mail queues, session files, caches, build artifacts, and badly rotated logs can create enormous numbers of small files. Track inode percentage beside byte percentage and investigate rapid changes.
# Summarize top-level directory size without crossing filesystems
sudo du -x --max-depth=1 /var 2>/dev/null | sort -n
# Find unusually large regular files on the current filesystem
sudo find /var -xdev -type f -size +1G -printf '%s %p\n' \
2>/dev/null | sort -n
Do not run unrestricted recursive scans at high frequency on busy production systems. They can add I/O load and may expose sensitive paths in logs. Schedule targeted scans during suitable windows, use least privilege, and store only the detail needed for action.
Distinguish capacity risk from disk saturation
A filesystem can be nearly empty while the underlying device is too slow for its workload. Disk saturation detection on Linux needs workload evidence such as latency, queue depth, throughput, and time spent busy. Install and use iostat from the sysstat package when these signals matter.
# Extended device statistics: one-second intervals, five reports
LC_ALL=C iostat -xz 1 5
# Pressure Stall Information for I/O contention
cat /proc/pressure/io
# Retained sysstat history when collection is enabled
sar -d
Interpret these metrics together. High utilization alone does not prove a problem, especially on virtual devices where the number has platform-specific meaning. Rising await time, persistent queueing, I/O pressure, and slower application or database operations provide stronger evidence. Compare against the same workload period and annotate deployments, backups, imports, and maintenance jobs.
Include filesystem and hardware error signals
Capacity cleanup will not solve a failing device or corrupted filesystem. Search kernel logs for I/O errors, resets, timeouts, read-only remounts, and filesystem-specific warnings. On physical drives, SMART or NVMe health data can add useful evidence, but RAID controllers and cloud block storage may expose health differently.
# Recent kernel storage messages
journalctl -k --since "24 hours ago" --no-pager | \
grep -Ei 'I/O error|filesystem error|read-only|reset|timeout|nvme|ata'
# Examples for directly visible devices
sudo smartctl -H -A /dev/sda
sudo nvme smart-log /dev/nvme0
A health flag is not a complete prediction of failure. Track changes in counters, understand the storage layer, and follow vendor or cloud guidance. When errors appear, protect data first: verify backups, reduce risky writes where appropriate, collect evidence, and follow a tested replacement or provider-escalation process.
Set warnings from response time, not convenience
A useful disk-full warning on Linux gives the owner enough time to act. If procurement or a cloud change takes five days, warning at two days of forecast headroom is too late. Build thresholds around remediation lead time and the consequence of crossing the limit.
- Healthy: collection is fresh, mount state is expected, and headroom exceeds the review window.
- Watch: growth is accelerating, an operating limit may be reached within the planning window, or inode use is unusual.
- Action: forecast headroom is shorter than remediation lead time, critical errors exist, or workload latency is affected.
- Unknown: the mount is missing, collection failed, or the data is too stale to support a conclusion.
Use separate rules for critical database storage, ordinary application data, backup destinations, and disposable cache volumes. Add hysteresis or require repeated observations so a value hovering near a threshold does not repeatedly change state. Suppress known maintenance only for a defined time and owner.
Prevent disk-full outages with a response playbook
Monitoring is only useful when a warning leads to safe action. Define who receives each severity, where evidence is recorded, and which changes require approval. Keep a short playbook for the common causes on each server.
- Confirm the affected filesystem, newest sample, and mount state.
- Identify growth by directory, application, logs, database files, snapshots, or deleted-open files.
- Check whether the growth is expected and whether it will continue.
- Protect backups and recovery options before deleting or moving data.
- Apply the lowest-risk remedy: correct retention, rotate safely, clear approved cache, resize, or migrate.
- Verify service health, free space, inode state, and trend collection after the change.
- Record the cause and adjust prevention rules if the incident exposed a gap.
Avoid emergency commands that delete broad path patterns without review. A full root or database filesystem can create pressure to act quickly, but deleting active logs, database files, or backup chains can turn a capacity problem into data loss. Test cleanup and resizing procedures before an incident.
Build a concise weekly disk-risk report
Small teams do not need to watch a dashboard continuously to manage gradual storage risk. A weekly report can summarize important filesystems, current headroom, seven- and thirty-day growth, estimated time to operating limits, inode risk, I/O-pressure changes, kernel errors, backup destination state, and the owner of each action.
Highlight changes rather than repeating every healthy metric. Carry unresolved items forward. Include the latest successful collection time so readers can judge freshness. When a fast-moving risk appears between reports, escalate it through the agreed operational channel instead of waiting for the next summary.
Practical server disk-risk checklist
- Map each important filesystem to its service, owner, and recovery impact.
- Collect byte capacity, inode capacity, filesystem type, and mount state.
- Retain history and calculate growth against a safe operating limit.
- Track I/O latency and pressure where workload performance matters.
- Review kernel, SMART, NVMe, RAID, or cloud-provider error evidence.
- Make stale or failed collection an explicit unknown condition.
- Set warning windows longer than the time required to remediate.
- Use targeted, least-privilege investigation commands.
- Maintain tested cleanup, resize, migration, and recovery playbooks.
- Summarize trends and owned actions in a short regular report.
Turn storage data into early decisions
Reliable disk risk monitoring combines capacity, inodes, growth, mount state, workload pressure, and error evidence. That combination helps a small team distinguish ordinary usage from an approaching outage and choose a safe response while there is still time.
DMCloud Architect turns Linux, MySQL, backup, and infrastructure signals into a concise weekly view of risks, trends, and practical next steps. Explore Infrastructure Health Reporting to catch storage trouble early without adding another dashboard to watch.