I've read in several places that it is recommended to bind-mount /var/tmp to /tmp. This can be done by adding the following line to /etc/fstab:

/tmp /var/tmp none rw,noexec,nosuid,nodev,bind 0 0

How can this be beneficial? In other words why should we bind-mount /var/tmp to /tmp ?

link|improve this question

79% accept rate
feedback

1 Answer

up vote 1 down vote accepted

The Filesystem HierarchyStandard says:

  • /tmp/ Temporary files. Often not preserved between system reboots.
  • /var/tmp/ Temporary files to be preserved between reboots.

For example: if an processus is launched every 5 minutes and needs to store some data between every launch, it will rather store them in /var/tmp/.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.