Home Wiki > openSUSE:Tmp on tmpfs
Sign up | Login

openSUSE:Tmp on tmpfs

tagline: From openSUSE

Please refer to Help:Editing in order to write a quality approved article.

Main References

openSUSE Factory

See the "Warning / ANNOUNCE : upcoming changes in upstream systemd regarding /media, /tmp and /var/run | /var/lock" mail thread on the opensuse-factory mailing list starting at:

http://lists.opensuse.org/opensuse-factory/2012-03/msg00400.html

Fedora

See the "Features/tmp-on-tmpfs" feature article at Fedora:

https://fedoraproject.org/wiki/Features/tmp-on-tmpfs

Debian

Debian has enabled tmpfs for /tmp since November 2011 on their development distribution. They are also enforcing maximum size for tmpfs (by default 20% of system memory).

Various mails on the topic "how to increase space for tmpfs /tmp" mail thread on the debian-user mailing list:

Opened bug reports against Debian related to tmpfs /tmp :


/tmp/ versus /var/tmp/

Use case for /tmp/

See the Filesystem Hierarchy Standard regarding "/tmp : Temporary files":

http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES

There is neither a restriction which kind of temporary files can be in /tmp/ nor a limit how big temporary files can be. It is recommended that files and directories located in /tmp be deleted whenever the system is booted.

Use case for /var/tmp/

See the Filesystem Hierarchy Standard regarding "/var/tmp : Temporary files preserved between system reboots":

http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE

Consequence

Applications that write huge files to /tmp/ which are not meant to be preserved between system reboots work in compliance with the Filesystem Hierarchy Standard and cannot be "fixed" by using /var/tmp/ instead because files in /var/tmp/ cannot be cleaned up automatically when the system is booted.

This conflicts with what is requested regarding "My CD burning application writes huge .iso files to /tmp, and this breaks on tmpfs! - The application should be fixed to use /var/tmp." at Fedora in

https://fedoraproject.org/wiki/Features/tmp-on-tmpfs#Comments_and_Discussion

If /tmp/ is on tmpfs there is the question what the right place is for arbitrary kind of huge temporary files which are not meant to be preserved between system reboots?


/tmp/ on harddisk versus /tmp/ on tmpfs

Currently /tmp/ is on harddisk. The question is whether or not this should be changed to /tmp/ on tmpfs. Basically "on tmpfs" means "stored in RAM plus swap if needed", see http://en.wikipedia.org/wiki/Tmpfs

Please focus on collecting all the pros and cons here, see http://lists.opensuse.org/opensuse-factory/2012-03/msg00661.html

Pros for /tmp/ on tmpfs

  • Files and directories located in /tmp are automatically deleted whenever the system is booted to be in compliance with the Filesystem Hierarchy Standard recommendation which avoids issues as in https://bugzilla.novell.com/show_bug.cgi?id=269870 (see below).

Cons against /tmp/ on tmpfs

  • Temporary files are gone after a system reboot, or crash - the time when you would likely need them. (on my 12.1 test system /tmp was cleared _never_ according to /etc/sysconfig/cron)
  • Existing applications expect to use /tmp for files that will _not_ fit in RAM (tried this with Blender, ignored TMPDIR too)
  • a search for /tmp bugs in bnc results in 51 bugs, so the current situation did not cause a lot of problems (https://bugzilla.novell.com/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=&content=%2Ftmp)
  • regularly cleaning up /tmp was denied explicitly by AJ in 2007 (https://bugzilla.novell.com/show_bug.cgi?id=269870)
  • using even more RAM is not a good option on low RAM systems ( <2GB IMO, like Netbooks or older PC's)
  • a little offtopic: changing /tmp in a way that requires "all" applications to be changed and adding more tmp dirs across the filesystem sounds like change for the sake of it, symlink /tmp to /var/tmp or bind mount to get the benefits instead.
  • A change from /tmp/ on harddisk to /tmp/ on tmpfs is two steps at once instead of first things first: First enable that files and directories located in /tmp are deleted by default whenever the system is booted. This must work fine as precondition to be able to do the second step: Switch from /tmp/ on harddisk to /tmp/ on tmpfs.

Communication

Team members


See also

Related articles

External links