Disk Full: Diagnostics & Troubleshooting
What to do when your drive runs out of space
Low disk space occurs when the available storage on a disk partition or volume is running out. This situation can cause various issues, including system slowdown, inability to install new software, and potential data loss. To diagnose and solve low disk space problems in Linux, you can use several tools and techniques.
Checking Disk Space
df command displays the amount of disk space used and available on all mounted file systems.
df -h provides a more readable output with sizes in human-readable format.
du command allows you to estimate the disk usage of files and directories. You can use it
with options like
-h for a human-readable output or
-s for a summary of disk usage for a particular directory.
Identifying Large Files and Directories
ncdu command (if installed) provides an interactive disk usage analyzer.
It allows you to explore disk usage and quickly identify large files and directories.
find command can be used to locate large files.
find / -type f -size +100M will search for files larger than 100 megabytes.
Cleaning Disk Space
Identify and remove unused software, temporary files, or large downloads that are no longer needed. Move or delete large files that are occupying excessive disk space.
Expanding Disk Space
If you're using a virtual machine or a cloud service, you can allocate additional disk space to the partition that is running low. The process for expanding disk space varies depending on the specific environment.
Alternatively, if you have multiple partitions, you can move data from a full partition to a less utilized one using
It's important to exercise caution when deleting or moving files, ensuring you don't remove any critical system files or important user data. Always review the files and directories before taking any action to avoid accidental data loss.
How CleverUptime can help
CleverUptime will alert you, before you run out of space. It monitors disk utilization and detects trends how quickly the disks are getting full.