IT Toolbox
Menu
HomeHow to find what fills a Linux drive
Guide

How to find what fills a Linux drive

It is necessary to distinguish space saturation, saturation in inodes and deleted files still open before cleaning a Linux server

TopicIT resources → About 1 min read

It is necessary to distinguish space saturation, saturation in inodes and deleted files still open before cleaning a Linux server.

Steps.

  1. Measuring volumes — Use df -h to locate the saturated file system.
  2. Check for inodes — Use df -i to exclude a lack of,inodes.
  3. Search for large folders — Use from the assembly point concerned.
  4. Search for deleted open files — lsof can reveal large files still occupied by a process.
  5. Clean in a targeted manner – Process logs, caches or data only after identification.

Commands

df -h
df -i
sudo du -xhd1 /var | sort -h
sudo lsof +L1

Key takeaways

  • Do not blindly delete /var/lib or files from a database.
  • A deleted but still open file continues to occupy disk space.
  • Check Logrotate if the logs are the recurring cause.

See also: LVM.

Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI

My favorites