2

Using fedora@latest, I have /tmp mounted as a tmpfs.

Sometimes I run some program that stores large files into it, until I fill it entirely.

I try to delete some files manually, hoping to free space, but the space isn’t freed.

I can tell it’s not related to an opened file handle, as I have been testing it manually and here are the results,

Before,

$ df -h
Sys. de fichiers        Taille Utilisé Dispo Uti% Monté sur
/dev/mapper/fedora-root    32G     20G  9,8G  68% /
tmpfs                     1,9G       0  1,9G   0% /tmp
/dev/sda5                 126G     71G   50G  59% /home

Then I copy a file onto it, with cp for the demonstration:

$ df -h
Sys. de fichiers        Taille Utilisé Dispo Uti% Monté sur
/dev/mapper/fedora-root    32G     20G  9,8G  68% /
tmpfs                     1,9G    487M  1,5G  26% /tmp
/dev/sda5                 126G     71G   50G  59% /home

Then I deleted the file, with rm

$ df -h
Sys. de fichiers        Taille Utilisé Dispo Uti% Monté sur
/dev/mapper/fedora-root    32G     20G  9,8G  68% /
tmpfs                     1,9G    487M  1,5G  26% /tmp
/dev/sda5                 126G     71G   50G  59% /home

Is this an expected behavior of tmpfs?

What can I do to fix that if this is unexpected?

1 Answer 1

7

This is not expected, except if those files are opened elsewhere. In this case the deletion request can succeed and appears to be effective but space will be freed when files are no more used.

You can see those deletion-pending files using lsof this way:

lsof -nP +L1 /tmp

As noted by @user75021 on another thread, there is a good lsof quickstart from which this command has been extracted (§3a).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .