/tmp This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up.
Tmpfs considered harmful
61–70 of 85 posts
Re: Tmpfs considered harmful
#62Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot" I believe there was never such expectation of /tmp. On many systems it's being wiped periodically or even when the user's last session ends. The example app(s) that use /tmp for drafts need(s) to be fixed.
Totally agree, /tmp should be wiped at the end of each session.
Re: Tmpfs considered harmful
#63My theory on this is that it's intended as a step to avoid SSDs writes.
Re: Tmpfs considered harmful
#64Re: Tmpfs considered harmful
#65Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot" I believe there was never such expectation of /tmp. On many systems it's being wiped periodically or even when the user's last session ends. The example app(s) that use /tmp for drafts need(s) to be fixed.
Sure, but if the power goes down, there's at least a chance that I may be able to find that long email I was writing. With /tmp on tmpfs, it's gone.
I've never had a problem with this using mutt, but if I cared, I'd switch it to use /var/tmp.
Either way, if there's a problem, it's with the program, not the filesystem - no need to use a cannon to kill a fly.
Re: Tmpfs considered harmful
#66The fact is, is that not every app that uses /tmp does so in a safe manner. As long as that is true, it's not a good idea to use tmpfs for /tmp. It's perfectly reasonable, however, to use tmpfs for, say, /var/local/tmp and let individual users point $TMP at that. Want to live fast and dangerously? Set $TMP.
Re: Tmpfs considered harmful
#67Re: Tmpfs considered harmful
#68Why on earth would anybody ever use tmpfs for /tmp? If I'm writing a program that deals with a big file, and I want to temporarily write something to the filesystem, it is because I dont want it in memory. Why would you ever write to /tmp for any reason other than to get something out of ram for a while?
Is there some better place than swap to accommodate /tmp?
Re: Tmpfs considered harmful
#69Earlier quoted context omitted.
That's like saying "RAM considered harmful", because every time a developer has to think "do I just store this in memory, or do I sync it to disk" "it forces a complex decision about the storage hierarchy": /tmp is simply RAM that has the API of a file; it used to be implemented using a horrible kludge with files on disk that were periodically deleted, but with tmpfs the dream became a reality.
RAM really is a harmful kludge. Neither Turing machines nor lambda calculus call for some of an algorithm's state to suddenly be obliterated. The only reason we put up with it is that disk and SSD are so much slower.
Re: Tmpfs considered harmful
#70Why on earth would anybody ever use tmpfs for /tmp? If I'm writing a program that deals with a big file, and I want to temporarily write something to the filesystem, it is because I dont want it in memory. Why would you ever write to /tmp for any reason other than to get something out of ram for a while?