News for hackers. Stuff that matters.
Re:Considerations for a long-running Raspberry Pi by Avamander on Saturday February 17, 2024 @05:20AM (#39408161)
In addition to /var, tmpfs should also be used for /tmp and similar. That should lengthen the SD card's lifetime immensely.
Re:Considerations for a long-running Raspberry Pi by diggan on Saturday February 17, 2024 @05:24AM (#39408172)
Isn't this (tmpfs for /tmp) the default setup for most OSes, and surely raspberry's homegrown OS too?
Re:Considerations for a long-running Raspberry Pi by marcosdumay on Saturday February 17, 2024 @07:50AM (#39408988)
A 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.

Re:Considerations for a long-running Raspberry Pi by adrian_b on Saturday February 17, 2024 @08:52AM (#39409400)
Copying 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.

Re:Considerations for a long-running Raspberry Pi by LtWorf on Saturday February 17, 2024 @08:14AM (#39409139)
Not the default in debian, because of low memory devices such as rpi.
Re:Considerations for a long-running Raspberry Pi by tyingq on Saturday February 17, 2024 @06:00AM (#39408361)
It seems it is not the default for Raspbian.
Re:Considerations for a long-running Raspberry Pi by diggan on Saturday February 17, 2024 @09:14AM (#39409573)
TIL! One would think if any distribution had it by default, it would have been Raspbian.
Re:Considerations for a long-running Raspberry Pi by tyingq on Saturday February 17, 2024 @11:35AM (#39410953)
Maybe left off since some of the models have very little memory to spare for a ramdisk?
Re:Considerations for a long-running Raspberry Pi by iforgotpassword on Saturday February 17, 2024 @06:10AM (#39408415)
I 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.
Re:Considerations for a long-running Raspberry Pi by gkbrk on Saturday February 17, 2024 @06:57AM (#39408667)
Arch uses tmpfs for /tmp.
Re:Considerations for a long-running Raspberry Pi by Macha on Saturday February 17, 2024 @07:18AM (#39408779)
Arch has you set up your own fstab so pushes the choice to the user?
Re:Considerations for a long-running Raspberry Pi by GrumpySloth on Saturday February 17, 2024 @09:46AM (#39409857)
During 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.
Re:Considerations for a long-running Raspberry Pi by gabrielhidasy on Saturday February 17, 2024 @09:55AM (#39409964)
Actually 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.
Re:Considerations for a long-running Raspberry Pi by carlhjerpe on Saturday February 17, 2024 @08:43AM (#39409333)
I ran out of space on NixOS with tmpfs, they run all builds in /tmp so my swap ran out.
Re:Considerations for a long-running Raspberry Pi by bonzini on Saturday February 17, 2024 @10:27AM (#39410288)
They should use /var/tmp instead.
Re:Considerations for a long-running Raspberry Pi by zitsarethecure on Saturday February 17, 2024 @09:24AM (#39409656)
Fedora uses tmpfs for /tmp. I think it still makes a lot of sense to use tmpfs for a heavily written-to transient file system.
Re:Considerations for a long-running Raspberry Pi by rootbear on Saturday February 17, 2024 @09:30AM (#39409698)
If 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.
Re:Considerations for a long-running Raspberry Pi by Too on Sunday February 18, 2024 @02:04AM (#39416869)
Surprisingly 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

Re:Considerations for a long-running Raspberry Pi by blacklion on Saturday February 17, 2024 @11:09AM (#39410702)
Anything 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.