tmpfs — deleting files won't free the space

mh-cbon

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?

A. Loiseau

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).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Deleting files doesn't free space

From Dev

Deleting files from HDFS does not free up disk space

From Dev

After deleting lots of large files, free space increases with a large delay

From Dev

Why deleting big files from tmpfs is not instantaneous?

From Dev

Why Won't free() Work?

From Dev

Why Won't free() Work?

From Dev

deleting files but disk space is still full

From Dev

after deleting some files. space is not freed

From Dev

How to free up vertica raw space after deleting records

From Dev

How to claim free space generated by deleting docker images in Mac

From Dev

How to free up unused space after deleting documents in ElasticSearch?

From Dev

faulted newly created files when no free space

From Dev

GetDiskFreeSpaceEx, free space not changing despite creating files

From Dev

Deleted files from home, deleted them from .local/share/Trash/files, System doesn't report back free space

From Dev

Vagrant -- E: Couldn't determine free space

From Dev

Can't extend partition to use free space

From Dev

Div block hasn't free space for buttons

From Dev

Div elements won't use whole space

From Dev

Space character in python that won't be interpreted by bash

From Dev

Div elements won't use whole space

From Dev

Div won't fill the empty space

From Dev

Files won't run as programs

From Dev

Docker ate all free space and can't be started to free it?

From Dev

Deleting files inside docker container not freeing up space on host system

From Dev

ext4 disk space not reclaimed after deleting files

From Dev

Rsync is not deleting files and complains of "No space left on device (28)"

From Dev

Deleting all small files whose filename has a space

From Dev

After deleting android database getReadableDatabase() won't create a new database

From Dev

Xcode won't add "Embedded binary" after deleting "DerivedData"

Related Related

  1. 1

    Deleting files doesn't free space

  2. 2

    Deleting files from HDFS does not free up disk space

  3. 3

    After deleting lots of large files, free space increases with a large delay

  4. 4

    Why deleting big files from tmpfs is not instantaneous?

  5. 5

    Why Won't free() Work?

  6. 6

    Why Won't free() Work?

  7. 7

    deleting files but disk space is still full

  8. 8

    after deleting some files. space is not freed

  9. 9

    How to free up vertica raw space after deleting records

  10. 10

    How to claim free space generated by deleting docker images in Mac

  11. 11

    How to free up unused space after deleting documents in ElasticSearch?

  12. 12

    faulted newly created files when no free space

  13. 13

    GetDiskFreeSpaceEx, free space not changing despite creating files

  14. 14

    Deleted files from home, deleted them from .local/share/Trash/files, System doesn't report back free space

  15. 15

    Vagrant -- E: Couldn't determine free space

  16. 16

    Can't extend partition to use free space

  17. 17

    Div block hasn't free space for buttons

  18. 18

    Div elements won't use whole space

  19. 19

    Space character in python that won't be interpreted by bash

  20. 20

    Div elements won't use whole space

  21. 21

    Div won't fill the empty space

  22. 22

    Files won't run as programs

  23. 23

    Docker ate all free space and can't be started to free it?

  24. 24

    Deleting files inside docker container not freeing up space on host system

  25. 25

    ext4 disk space not reclaimed after deleting files

  26. 26

    Rsync is not deleting files and complains of "No space left on device (28)"

  27. 27

    Deleting all small files whose filename has a space

  28. 28

    After deleting android database getReadableDatabase() won't create a new database

  29. 29

    Xcode won't add "Embedded binary" after deleting "DerivedData"

HotTag

Archive