4 ms·
In addition to /var, tmpfs should also be used for /tmp and similar. That should lengthen the SD card's lifetime immensely.
by Avamander 3y ago
In addition to /var, tmpfs should also be used for /tmp and similar. That should lengthen the SD card's lifetime immensely.
- diggan 3y agoIsn't this (tmpfs for /tmp) the default setup for most OSes, and surely raspberry's homegrown OS too?
- tyingq 3y agoIt seems it is not the default for Raspbian.
- iforgotpassword 3y agoI think all the usual desktop distros don't use tmpfs for either by default. I don't see the benefit in this with modern hardware.
- gkbrk 3y agoArch uses tmpfs for /tmp.
- Macha 3y agoArch has you set up your own fstab so pushes the choice to the user?
- GrumpySloth 3y agoDuring installation the guide tells you to run a program, which generates an fstab based on current mounts. So by default it will configure /tmp the same way it’s configured in the live cd.
- gabrielhidasy 3y agoActually the installation guide for arch asks you to use `genfstab -U /mnt >> /mnt/etc/fstab` which basically copies over whatever was mounted at the live environment (taking off the /mnt), I'm pretty sure tmpfs for /tmp was there by default last time I installed.
- lillecarl 3y agoI ran out of space on NixOS with tmpfs, they run all builds in /tmp so my swap ran out.
- bonzini 3y agoThey should use /var/tmp instead.
- zitsarethecure 3y agoFedora uses tmpfs for /tmp. I think it still makes a lot of sense to use tmpfs for a heavily written-to transient file system.
- marcosdumay 3y agoA long time ago, it used to be. It doesn't seem to be now, and I don't have any idea why the distros changed. (Maybe it's due to the mv semantics? But I though people considered the idea of creating a file in /tmp and then renaming it to be bad instead.) In fact, I didn't notice the change until now.
- adrian_b 3y agoCopying or moving through tmpfs loses silently some file metadata, e.g. extended attributes or high-resolution filestamps. Copying through /tmp is a frequently used method for transferring files between users on a multi-user computer. It is said that the Linux kernel will include soon an improved version of tmpfs, which will allow user extended attributes, within certain limitations. When this will happen, one of the most annoying misfeatures of tmpfs that has persisted for much too many years will finally be gone away.
- LtWorf 3y agoNot the default in debian, because of low memory devices such as rpi.
- rootbear 3y agoIf I had to guess, I would assume they chose not to use tmpfs because the earlier Pis had very limited RAM. With a 4GB or 8GB pi 4 or 5 this should not be a problem.
- Too 3y agoSurprisingly often not! Be careful to check inside your docker containers also. It can end up different. Here is a good article btw, with someone advocating for moving to tmpfs https://ubuntu.com/blog/data-driven-analysis-tmp-on-tmpfs https://ubuntu.com/blog/data-driven-analysis-tmp-on-tmpfs
- blacklion 3y agoAnything transient writable must be in memfs/tmpfs/how it is mamre im your OS, of course. Logs to log server, if system needs non-volatile writable storage — NFS or second storage device, depending on requirements. Of course, it is too much hassle for single such system (but I started to use it from very beginning out of curiosity) but uf you have many single-task small devices it is very convenient.