Ghostboard pixel Skip to content

Debian 13 is Changing the /tmp Behavior

Debian 13 has decided on a new way to mount the /tmp directory.

Nowadays, most popular distributions use the Tmpfs file system to handle temporary files. When in use, such files are loaded onto volatile memory (RAM in this case), instead of a persistent storage device like an SSD or Hard disk.

What this accomplishes is the removal of temporary files/folders after a reboot, resulting in saved storage space, and no clutter. Moreover, you also benefit from faster retrieval times compared to persistent storage devices.

Sure, there are disadvantages, such as on systems without enough swap space where Tmpfs could take over large amounts of memory, but that's an issue if you are running with a modest amount of RAM.

Surprisingly enough, Debian never really caught on to the trend. Going back to 2012, there were calls to switch to a tmpfs system of handling temporary files, but, it never really came to pass, until now, that is.

Debian Finally Takes the Leap: Better Late than Never?

debian tmp

Announced by Debian developer Luca Boccassi on the debian-devel mailing list. Debian has finally switched to a RAM-based Tmpfs system of handling /tmp files for the upcoming Debian 13 “Trixie” release.

In this set up, /tmp would be a Tmpfs by default, with files over 10 days being deleted on new installations, and for /var/tmp, the allowance period is longer, with files over 30 days being deleted from the persistent storage.

This has already been implemented in the testing builds of Debian Trixie.

As I mentioned earlier, this is not something new, calls for it were made before too.

Luca rekindled an earlier discussion from 2020, which had mentioned how Debian's systemd implementation didn't match systemd's default behavior for handling /tmp and /var/tmp.

Of course, doing that led to a series of discussions and arguments among members before a decision was made.

One such argument was by Michael Biebl, who feared about the potential effects of cleaning temporary files by default. He mentioned that “Defaults are defaults, they are trivially and fully overridable where needed if needed.”, and that gathering feedback from all affected parties was required to make an informed decision.

Luca replied with the following:

It's impossible to have defaults that make everyone happy, there will
always be someone who doesn't like any choice one might pick (there
are people unhappy with the current ones too).

He also asked; “what would break where, and how to fix it?

In response to that, many reasonable questions were asked by others, but, ultimately, Luca went ahead with this change.

In my opinion, it is great to see Debian at long last joining other distros in implementing Tmpfs and automatic deletion of files for the /tmp and /var/tmp folders. Not doing so has been allowing unnecessary junk files to clog up the local storage.

With this development, another question arises; Will Ubuntu follow in a similar path?

We all know that Ubuntu usually more or less conforms to what Debian does, unless it is the matter of Snaps, then it does its thing. 😉

Needless to say, Ubuntu has chosen (comment #4) to follow the same path, with one key difference, for now, they won't be extending the cleanup age for /tmp to the 30 days period, they intend to do it later.

Furthermore, they won't be backporting these changes to older Ubuntu releases.

After this decision was made public, lively conversation among the members of the community has ensued, with one person saying that:

/var/tmp, IMO, shouldn't exist--the idea of temporary files that should persist beyond a reboot is tech debt, those files should exist under a proper /var/{cache,lib} directory. Podman uses this directory and it drives me nuts.

💬 What do you think of the move? Did Debian pick the right course of action? Add your thoughts below!

Thanks LWN for bringing this to my attention. You guys do a great job! 😃

More from It's FOSS...