Fractal Techware

Alert runbooks /

NodeFilesystemAlmostOutOfFiles

A writable filesystem on this host has almost no free inodes left, so creating files will soon fail with “No space left on device” even though df -h looks fine.

   
Severity warning, critical
Source node_exporter 1.x, filesystem collector
Key metrics node_filesystem_files, node_filesystem_files_free, node_filesystem_readonly

What it means

Every file, directory and symlink uses one inode, and most filesystems (ext4 in particular) fix the inode count when the filesystem is created. The alert fires when free inodes on a read-write mount have stayed low for a sustained period. Pseudo filesystems and container overlay mounts are excluded.

The warning means inodes are running low and you have time to clean up. Critical means the filesystem is close to exhausted: log rotation, package installs, sockets, lock files and databases can start failing at any moment.

Common causes

First checks

  1. Find the most inode-starved filesystems across the fleet:
    bottomk(10, node_filesystem_files_free{fstype!~"tmpfs|overlay|squashfs"})
    
  2. Confirm on the host:
    df -i
    
  3. Find which directories hold the most inodes (stays on one filesystem):
    sudo du --inodes -x / 2>/dev/null | sort -n | tail -20
    
  4. Drill into the top directory to find the exact producer:
    sudo find /var/<dir> -xdev -type f | cut -d/ -f1-5 | sort | uniq -c | sort -n | tail
    
  5. Check whether usage is still growing, to judge urgency:
    deriv(node_filesystem_files_free{instance="<instance>", mountpoint="<mountpoint>"}[1h])
    

Fixing it

Delete or archive the small files (for huge directories, find <dir> -type f -mtime +7 -delete is faster than rm *). Then stop the source: fix the application, add a systemd-tmpfiles or cron cleanup, or prune container images with crictl rmi --prune or docker image prune. If the workload legitimately needs many files, move it to a filesystem with more inodes (XFS allocates inodes dynamically) or recreate ext4 with a smaller -i ratio.