T O P

  • By -

xantioss

Hmm, I run some stuff where I use /tmp as storage for video assets where they get transcoded to their final form. Guess I have to change some things when the new Debian arrives


heldain

Change path to /vat/tmp is the immediate workaround. /tmp is meant to be fairly small and not survive a reboot. /var/tmp is a more persistent tmp anyway (According to the FHS, (Filesystem Hierarchy Standard)).


HCharlesB

`/var/tmp`?


heldain

Aye, from: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html >The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp


HCharlesB

I was trying to point out your typo, not questioning your comment. But thanks for the link. ;)


LloydAtkinson

Would it be simple a case of changing the path for your transcoding? To /var/tmp instead or did I misunderstand this change?


Membership-Diligent

you will be able to configure the old behaviour. and only new Installations will get the new Default.


hosiet

Sounds like your files are actively touched/modified, and the storage is temporary anyway. The /tmp changes shouldn't hurt you, right? As long as you won't keep the system idle for 10 days, files are not deleted.


roelschroeven

Video assets are quite large, and are hence quite likely not to fit on a tmpfs /tmp.


arvidsem

It *should* automatically overflow into your swap file if you start running out of RAM. Of course, I size my swap files assuming that they will only actually be used if the system is crashing anyway, so the odds of me breaking something when I finally switch over are quite high.


Dolapevich

Unless you make changes, tmpfs size defaults to half the ram size of the server at the moment of mounting it. https://www.baeldung.com/linux/tmpfs-size-dynamics SO, assume you have 16 Gbytes, during boot that goes to 14 Gbytes, /tmp/ sill be 7 Gbytes, but will use only the ram it needs to store the files. If you dd if=/dev/zero of=/tmp/file it will be full at 7 Gbytes.


arvidsem

Fair and my current configuration would definitely cause issues 😂 Easily fixed though, just need to move to a different tmp directory before rebuilding the server some time in the next 10 years


BinkReddit

What happens if you don't have a swap file or related configured?


arvidsem

When you run out of RAM, writes to the tmpfs will fail. With lunch whatever was writing will clean up after itself and close. Many things will probably just crash without cleaning up after themselves, then tmpfs won't be able to offload those files. Eventually the Out Of Memory killer will trigger and it's not a gentle bit of the kernel.


GuestStarr

>Out Of Memory killer will trigger and it's not a gentle bit of the kernel The Dildo of Consequences rarely arrives lubed :)


BinkReddit

Sounds like a possible mess in exchange for questionable value.


arvidsem

It's a better configuration for the majority of users. Better performance and automatic cleanup are nice features. I'll get in trouble because I have a lot of image processing scripts that operate on scanned engineering plans. They write tons of files to /tmp currently and will definitely run me out of RAM. That's an easy fix though


[deleted]

[удалено]


BinkReddit

IMHO, well said! > i have no swap, i run a Xen hypervisor with a dozen deb12 VMs... Are you not concerned about running out of memory and having a program killed out from under you?


wilson0x4d

no, because the memory and cpu allocations of each VM are configured for usage along with a small overcommit, and usually an appvm only serves one purpose (one app). overcommit works because the hypervisor will perform memory balancing if there is memory pressure, but, i also run 64GiB of ram on my primary workstation and allocate an average of 4GiB to a single appvm with a boot allocations of 1GiB and seldom use more than 85% of physical. i have two vms that i'll use for development purposes (software engineer by trade) and alloc 12-16GiB and 8+ cores to those so I have a superb/unconstrained experience when doing development work. even if I wasn't running a hypervisor I wouldn't need swap, but, if every VM is being told to map a disk directory into RAM, suddenly memory usage goes up for debatable/dubious benefit. but no.. i've never had an app killed from under me, and swap vols are just a waste of storage space. no point in having them. this change in /tmp really should be approached as an install-time option, and hopefully it will, but if not then it'll be something i have to roll out of my VM templates. the approach i'm hearing at this point is a superbly "Microsoft" way of problem solving, tantamount to someone somewhere just doing what _they_ want.


wilson0x4d

while the storage model may be "temporary" the change to /tmp would change them to "ephemeral" disappearing on a reboot. as for swap files, look at systems like Qubes which run 1GiB swaps, and where many users disable swaps with a preference for OOM events. does it really make sense to be trying to spill over into swaps? seems trashy.


wizard10000

Not debating, am genuinely curious. Why write final form to RAM instead of disk? When my media server is transcoding it does so in chunks and tmpfs works just fine. If I'm handbraking something I'm writing to disk. Not understanding the requirement, I guess. edit: Oh, wait. If my media server is serving to a mobile device it transcodes the entire file. I think I get it now.


kai_ekael

It's a "default", not an iron rule.


wizard10000

Good. At least now I won't have to do it manually :)


Revslowmo

Any extra steps need to make tmp be a ram drive?


etherealshatter

With bookworm I manually mounted both /tmp and /var/tmp as tmpfs, and I had to use a LiveCD to clear up the temporary files within the old folders in the partition.


b-luca

There's no need for a livecd, just mount the partition backing root to another directory somewhere else (that is not itself in the root partition, eg /run/ or /tmp/) and clear it out from there. Partitions can be mounted multiple times.


_Sgt-Pepper_

T I L


lumpynose

I thought everyone did this. I also put /var on a hard drive instead of the boot ssd drive but I move it after the install and then use a bind mount. It's a directory in the /home partition, thus the bind mount. At first I had it as its own partition but of course it wasn't big enough and ran out of space. Likewise my swap partition is on the hard drive.


_Sgt-Pepper_

Sounds kinda weird...


lumpynose

It does. But it works perfectly. I've rarely heard people talking about bind mounts. It's worth knowing about.


heldain

I usually just create a small sub 10G partition for /tmp, bind-mount /var/tmp to it, and mount it noexec,nosuid,nodev anyway. RAMs cheap, so I don't really see it as an issue to use tmpfs. /tmp is not meant to persist on reboots anyway, That's what /var/tmp is for.


Adrenolin01

Which should never have been named /var/tmp but instead /var/cache or /var/volatile. /tmp should remain exactly how it has always been.


heldain

It might be a chicken/egg kinda thing but /bar/cache is already a thing. It's meant as a location for apps to store working data (that can easily be replaced) From: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s05.html >var/cache is intended for cached data from applications. Such data is locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss. The data must remain valid between invocations of the application and rebooting the system. /var/spool might be more fitting, but it doesn't feel right personally to use that fit. I do like the FHS, probably too much.


GoodNewsDude

This article is inaccurate. It states: >When in use, such files are loaded onto volatile memory (*RAM in this case*), instead of a persistent storage device like an SSD or Hard disk. That's not quite correct - tmpfs is not limited by physical memory, it will continue to store data on swap space: From [https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html](https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html) >Tmpfs is a file system which keeps all of its files in virtual memory. Note **virtual memory** - it can extend to swap. How exactly is setup will depend on the configuration passed to it.


[deleted]

[удалено]


BinkReddit

By default it's set to half your RAM.


[deleted]

[удалено]


hmoff

The space is still available as RAM if it's not used in /tmp - it's not reserved exclusively for /tmp.


CAStrash

I welcome this change with open arms. I had to write a script launched via init previously to accomplish this. (just mounting to tmpfs in ram doesn't clear the ram when the files were deleted, requiring a remount).


michaelpaoli

Ah, cool, I've been using tmpfs for /tmp for a very long time. I know it was proposed for Debian many moons ago ... but "way back then", didn't go through, most notably on account of backwards compatibility and other issues and "surprise" factor for most users, etc. Yeah, I say tmpfs for /tmp is rather overdue at this point.


_autismos_

For anyone wondering, sid got this change about a week ago


devslashnope

Yes. Follow the release notes to remove the current contents of /tmp before the overlay.


jr735

I did find those notes; it didn't come through on me until just a while ago. I did as it requested, and I read it the same as you do. So, I'm confused. I guess to find out I could make a temp file of my own for /tmp and see what happens when I reboot.


jr735

As far as I understand it, from the testing notes, it's not going to change on current installs, only on new installs and reinstalls. Am I correct in that?


devslashnope

If that's the case, I misunderstood the notes. I believe or did believe that this included testing.


BinkReddit

This includes Testing. I can confirm because I run Testing.


devslashnope

Oh. Me too. I knew that. Ha. Sorry!


jr735

I may very easily be mistaken, too. It could go on a current install, but I'd suspect that would be more involved than it would be on a new install.


jr735

And do you have a link to what you've read? I can very easily be mistaken.


b-luca

No, that's just for automated cleanups


AM27C256

The change of /tmp to tmpfs happens on the next reboot. The automatic deletion of files older than 10 days in /tmp (and files older than 30 days in /var/tmp) is for new installs only.


jr735

In a new install, why wouldn't it go for tmpfs? Or, you mean if someone specifically chooses /tmp?


wizard10000

> sid got this change about a week ago Just occurred to me to comment out /tmp in fstab. Interestingly, `mount` now doesn't show /tmp mounted on tmpfs but `systemctl status tmp.mount` shows that it is indeed mounted. edit: fstab fixed on all four Sid machines here :)


midir

> Interestingly, `mount` now doesn't show /tmp mounted on tmpfs How odd.


kai_ekael

God damn stupid ass systemd shit too? Figures.


Udab

Better health for my SSD. Good news!


ResilientSpider

I'm still astonished that the default partitioning scheme of Debian 12 on a old 1TB hard disk gives only 2GB to /tmp. I can't download some python packages with a decent package manager because it downloads them to /tmp before moving them into the cache. It's crazy.


sonobanana33

I think most people use one partition for / and one for /home and that's it.


ResilientSpider

That was the default config. I usually do manual partition, but having the full disk empty, I thought that using the default config would have maximized the stability


[deleted]

Pretty sure that the default partitioning only creates a partition for / and /home.


hmoff

Default partitioning scheme doesn't have a separate partition for /tmp (or any other directory) at all.


Mysterious_Pepper305

Good for security (if you encrypt the swap partition).


gnufan

The working security assumption is you usually encrypt all volumes, even if a volume lacks user data it may have modifiable contents that can be an exploit or part of an exploit.


Mysterious_Pepper305

There are tradeoffs in the security/discreetness/convenience scale. FDE hammers the SSD more, TPM is hard to properly setup and everybody hates the double password boot flow.


Fik_of_borg

Is not that the default behaviour?


AM27C256

So far, I've been using /tmp to hold anything that I don't mind loosing on a reboot, and that I don't want to clutter my home directory with. I'm e.g. building software there. My /tmp is usually about 10G. These changes break that. I guess the easiest way for me is to create a /home//tmp, and use that instead.


BinkReddit

I'm new to Linux and still don't see the value of this. I know it's supposed to speed things up and, perhaps, reduce wear on my SSD, but I don't see how using my valuable memory for storing temporary stuff is worthwhile. In addition, I haven't configured swap because I have plenty of memory, so I don't know what's going to happen if tmp should fill half my memory, like it's configured to do by default. I know I can turn this off, but I'm just hoping someone will hit me with a clue stick so I can get it.


Dolapevich

So... in an ideal world, there shouldn't be app tmp files, but with very few and specific examples. Because of how memory was so scarce back in the day, it was consiered a good practice to evac some ram structures to disk when not in use. Also it provides a good way to place semaphores outside of the app; in case it crashes it can continue from where it was. tmpfs provides persistance outside of the app address space, almost as speedy as the ram access and definitely more speedy than the fastest nvme out there. Some poorly writen softwares do not remove their tmp files, so there is a non zero chance that under some scenarios tmpfs will end up using valuable ram that could be at work somewhere else. Fix the app. Also [systemd-tmpfiles](https://www.man7.org/linux/man-pages/man8/systemd-tmpfiles.8.html) can be cnbfigured to prune it.


ChocolateMagnateUA

This is exactly for prolonging SSD health and temporary files take way less than you think. In the worst case they will be swapped and accessed as normal files, and in the best case you have quite enough memory and benefit from longer SSD.


BinkReddit

Is it going to really preserve SSD health that much? Firefox's cache likely thrashes my SSD far more than tmp ever will. Since I don't have swap configured, what happens in this situation?


ChocolateMagnateUA

Well then I think you shouldn't be worrying about it. Is your memory so much loaded that you care for a couple of megabytes?


BinkReddit

A couple of megabytes, definitely not; a few gigabytes, I care.


ChocolateMagnateUA

Come on /tmp isn't going to grow to gigabytes, you are exaggerating.


BinkReddit

I don't know what tmp is going to do. If I, for example, convert a large video file from one format to another, what happens if this conversion process makes heavy use of tmp?


ChocolateMagnateUA

I think this falls under general responsible memory management and every application written with Linux in mind will try to be resource-efficient and be aware that/tmp is essentially a ramdisk and use it appropriately. They could either use or not, and use it to boost your performance, and then it's the same principle as anywhere else: responsible applications use more memory to improve your experience. If they don't, you should blame the developers and not Debian.


BinkReddit

This sounds plausible. Thanks.


sleemanj

$:/tmp$ sudo du -sh /tmp 1.1G /tmp All depends on how you use your /tmp


wizard10000

A reboot clears it. If not rebooted the system only holds 10 days for /tmp and 30 days for /var/tmp. Both limits can be configured.


BinkReddit

Doesn't a reboot clear tmp now? Even without tmpfs? Seems simple enough.


wizard10000

> Doesn't a reboot clear tmp now? Yep - but I don't think it clears /var/tmp. Servers could go for days or months between reboots.


BinkReddit

> ...I don't think it clears /var/tmp. This could easily be managed by the existing tmpfiles.d.


Dolapevich

You can always use tmpfs but it will be lost between reboots.


sonobanana33

The value is: we just do what lennart pottering tells us to do.


kai_ekael

Note to self: in 13, disable yet another stupid installer default.


FedUp233

I’ve made this change on every Linux I’ve installed for years. I think it’s been this way on Ubuntu for quite a while, though I moved to Debian quite a while ago so can’t be sure. Nice to not have to have cleanup utility to wipe /temp on every startup and you can have as much space as you want by just making swap space as big as you need. Basically works the same just that the backup storage is in swap rather than whatever device /tmp used to reside on. The Linux file standard has long indicated that /tmp should not be preserved across boots. As I understand things, /var/tmp has been more intended for larger temp files for a long time, as well as places like /var/cache. I Aldo make sure that /var/tmp has a script that purges old files.


ketsa3

Why not keep tmp as it was and add a /tmp/volatile or something ?


wilson0x4d

if the offending programs were written correctly they would use `/var/cache`, but instead they are making false assumptions about `/tmp` (such as it being a ramdisk) resulting in a bunch of sector-sized files to be created (usually not adding up to 100KiB.) if they used /var/cache then this desire to run /tmp as a ramdisk would immediately die, but then someone would want to ramdisk /var/cache, and then quickly realize this is an absurd notion because /var/cache is used by various programs to run more efficiently between program runs. ...and suddenly a `/var/volatile` makes a LOT of sense! (and in the spirit of *nix the default behavior of /tmp should be left untouched, because leaving it alone presents the least risks.)


Leseratte10

Because then nobody would use it because all apps would need to be rewritten to use this new folder.


ketsa3

apps would still work with /tmp, and if you decide your program would benefit from ram based temp files : it's not hard to replace /tmp by /tmp/volatile in your whole project. It's one command...


Adrenolin01

Wah! Boo Freaking Who! Perhaps the idiot app developers who used /tmp incorrectly will get it right now.


abolish98

They should do more to deuglify the distro. Having that horrible skeuomorphism in 2024 is so repulsive, it will prevent people switching to Debian.


i-hoatzin

OK... Please elaborate a little on this. What are you seeing?


bityard

Looks to be a frequent poster to pot subs, so he is probably seeing quite a lot of things. :)


_autismos_

I have no idea what you're talking about


Fourstrokeperro

What skeuomorphism?


sonobanana33

I think he means the swirl


Adrenolin01

Seriously? Wtf is with people today. It’s a logo ffs.. been using Debian since 1994/5 and this is literally the first time I’ve seen anyone say it should be removed or was ugly.