The Spatial Storage Interrogation
When operating a headless Ubuntu server, running out of space on the root partition is a catastrophic architectural failure. The kernel will instantly halt database writes (corrupting MySQL), refuse to write new syslog entries, and actively prevent SSH login sequences if there is zero space left on the solid-state drive. You cannot wait for a graphical warning to appear. You must instruct the Linux kernel to proactively execute a spatial storage interrogation, querying the file system blocks and outputting a precise mathematical breakdown of every mounted partition.
How to Check Disk Space in Ubuntu
The Ubuntu architecture utilizes the `df` (disk free) utility, a highly optimized C program designed to query the system’s mount table and calculate the delta between allocated sectors and available blocks on the storage media.
1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Human-Readable Output (`df -h`):
* This is the mathematically superior and industry-standard method. If you execute a raw `df` command, the kernel outputs the data in raw 1K blocks, which is nearly impossible for humans to parse quickly.
* Type exactly:
df -h
* Press Enter.
* The `-h` (human-readable) flag instructs the kernel to mathematically convert the raw blocks into Gigabytes (G), Megabytes (M), and Terabytes (T).
* The Output Matrix: The terminal returns a structured grid.
* Filesystem: The specific partition (e.g., `/dev/sda1` or `/dev/nvme0n1p2`).
* Size: The total mathematical capacity of that partition.
* Used: The exact amount of data currently written.
* Avail: The critical number—how much space is left before a system crash.
* Use%: The percentage of the drive currently occupied.
* Mounted on: Where the partition is attached to the OS (look specifically for `/`, the root partition).
3. Method 2: The Inode Audit (`df -i`):
* Crucial Failsafe: A Linux system can mathematically “run out of space” even if it has 500GB of free capacity, if it exhausts its supply of inodes (the index entries required for every single file). This happens if a script generates millions of tiny 1-byte files.
* Type exactly:
df -i
* Press Enter. Check the `IUse%` column for the `/` partition. If it is at 100%, you cannot write any new files, regardless of free disk space.
4. Method 3: The Granular Directory Audit (`du -sh`):
* If the `df` command confirms you are at 99% capacity, you must locate the massive files causing the bottleneck.
* The `du` (disk usage) command calculates the exact size of a specific folder.
* Type exactly: sudo du -sh /var/log/
* Press Enter. The kernel calculates the total byte size of that specific folder, helping you hunt down bloated data payloads.