Linux No Space Left on Device? Check Inodes, Too

A download fails with “No space left on device,” yet your computer appears to have gigabytes free. Before deleting your largest files, check the filesystem receiving the write. Free space on another partition will not help, and on some filesystems the missing resource may be inodes rather than storage blocks.

The commands below inspect usage without removing files. They assume the GNU versions of df and du commonly included with Linux distributions. Keep the failed application’s destination path handy; it is more useful than a general impression that the whole disk is full.

Check the exact destination first

df -h /var
df -i /var

Replace /var with the existing directory where the failing application writes. The df manual explains that a path argument reports the filesystem containing that path. The first command shows storage usage in readable units; the second shows inode usage.

Compare the available space and inode columns. A filesystem with spare gigabytes but no free inodes points to a different problem from one that has run out of data blocks. Check the mount point in the output, too: /home, /var and /tmp can live on separate filesystems.

Why small files can still fill a filesystem

The Linux inode documentation describes the metadata associated with a file, such as ownership and type. On filesystems with a finite inode pool, many small files can exhaust that pool while leaving substantial data capacity unused. Removing one large archive would free bytes, but very few inodes.

That is why file size alone can be a misleading cleanup guide. An application creating large numbers of tiny cache entries needs a different investigation from a folder containing several oversized video exports. Inode allocation also varies by filesystem; interpret the figures for the filesystem you actually have.

Find the directory using the resource

du -x -h --max-depth=1 /var
du -x --inodes --max-depth=1 /var

The GNU du options let you compare directory storage with inode usage. Here, -x keeps the scan on one filesystem and –max-depth=1 limits the displayed summary to the starting directory and its immediate children. The scan still visits deeper files, so a large tree may take time.

Replace /var consistently with your chosen path. Follow the unusually large result one level deeper rather than scanning unrelated areas. Permission-denied messages mean the totals may be incomplete; use an appropriately authorized account when inspection requires it. Do not hide those errors and assume the remaining numbers describe everything.

Clean up through the application that owns the files

Once you identify the busy directory, work out what created its contents. Prefer the application’s documented cache or retention controls over deleting an unfamiliar system directory. A cache, a mail queue and a database directory can all contain many files, but they are not interchangeable cleanup targets.

After an approved cleanup, repeat both df commands against the same destination and retry the original operation. If space and inodes are available but the error continues, preserve the exact message and investigate the application and filesystem limits further. Avoid continuing to delete files just because the first cleanup did not resolve it.

Visited 1 times, 1 visit(s) today

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top