Did you know?
Debian 13 keeps /tmp in memory, so it is emptied at every reboot.
Use /var/tmp for temporary files that must survive a restart.
- Files & directories
- Applies to Debian 13
- Last checked
Explained
Starting with Debian 13 (trixie), /tmp is mounted as tmpfs, a file system that lives in RAM. Anything you put there is gone after the next reboot. By default the tmpfs can grow to half of the system memory, and the space only counts against RAM while files actually use it.
Debian 13 also cleans up old temporary files automatically: systemd-tmpfiles deletes files in /tmp that haven’t been used for 10 days, and files in /var/tmp after 30 days.
Check how /tmp is mounted on your system:
findmnt /tmp
If the FSTYPE column says tmpfs, the directory is in memory. If your /etc/fstab already has its own /tmp entry, that entry wins.
Scripts that download large files, build packages or keep state between runs should use /var/tmp or a directory of their own instead. To go back to a disk-based /tmp, mask the mount unit and reboot:
sudo systemctl mask tmp.mount
Fedora has used a tmpfs /tmp for years, so the same advice applies there.
Learn more
- Linux Filesystem Hierarchy Standard (FHS): Every Directory Explained Full guide · Updated Nov 2026
