The Storage Telemetry Vector
When an Ubuntu server running a heavy production database (like PostgreSQL) or a massive media library reaches 100% disk capacity, the entire operating system will critically fail. Log files cannot be written, updates will crash, and the server will essentially lock itself down. Before you blindly provision expensive new storage volumes from your cloud provider, you must execute a command-line interrogation to analyze the exact mathematical distribution of the physical drive space and determine which partitions are approaching critical mass.
How to Check Disk Space in Ubuntu
The Linux environment utilizes the dedicated `df` (Disk Free) utility, a hyper-efficient binary engineered to parse the core file system tables and output a highly readable telemetry grid regarding block allocation.
1. Open your terminal application or connect to the server via SSH.
2. The Primary Diagnostic Command (`df`):
* Typing the raw command `df` will output the data in 1K blocks, which is mathematically unreadable for a human analyzing a 500GB server (e.g., `512349000`).
* You must append the -h (human-readable) flag to force the tool to calculate the data into Gigabytes (G), Megabytes (M), or Terabytes (T).
* Type exactly:
df -h
* Press Enter.
3. Analyzing the Telemetry Grid:
* The terminal will output a matrix detailing every mounted file system. You must filter the data visually:
* Ignore loop devices (e.g., `/dev/loop0`). These are virtual filesystems used by snaps and contain no user data.
* Look for your primary physical partition, usually mounted on the root directory (`/`). It is often labelled something like `/dev/sda1`, `/dev/vda1`, or `/dev/mapper/ubuntu–vg-ubuntu–lv`.
* Focus on the row corresponding to your root partition (`/`).
* The Critical Columns:
* Size: The absolute maximum capacity of that specific partition (e.g., `49G`).
* Used: The exact amount of storage currently occupied (e.g., `42G`).
* Avail: The true amount of empty space remaining (e.g., `4.5G`).
* Use%: The most important number. If this hits `95%` or higher, the server is in imminent danger of a critical storage failure.
4. The Deep Interrogation (`du`):
* If `df -h` reveals your drive is 99% full, you must locate the massive files causing the issue.
* Use the `du` (Disk Usage) command on the root directory, sorted by size, to hunt them down.
* Type: sudo du -h --max-depth=1 / | sort -hr