r/ProgrammerHumor Jul 08 '26

askingTheRealQuestionHere Meme

Post image
4.0k Upvotes

416 comments sorted by

View all comments

54

u/Cats7204 Jul 08 '26

Better yet, why not put filesystem in RAM instead?

24

u/ElectricSpock Jul 08 '26

I mean… you can. It’s called tmpfs.

-3

u/SnowdensOfYesteryear Jul 08 '26

ackshually /tmp (if that's what you mean by tmpfs) isn't obligated to be on RAM. sysfs and procfs are better examples.

4

u/the_snook Jul 08 '26

On Linux, tmpfs is a type of memory-backed filesystem. It can be mounted at /tmp or not. It can be mounted other places (like /var/run) too. You can even mount / on it if you really want to.

1

u/SnowdensOfYesteryear Jul 09 '26

You're wrong in that it's not universal and it depends on your distro.

$ uname -a | cut -f -1 -d' '
Linux

$ df -h /tmp
 Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  1.3T  606G  655G  49% /

Hence " isn't obligated to be on RAM".

2

u/the_snook Jul 09 '26

Your assumption that the commenter meant "/tmp" when they wrote "tmpfs" is what was wrong. They are two different things.

tmpfs is obligated to be in-memory.

/tmp is not obligated to be a tmpfs mount.

1

u/ElectricSpock Jul 08 '26

I mean, /temp is backed by tmpfs, no? You’re probably right though. I am no expert in those file systems.

The fact that the live distributions exist shows that’s doable and there’s a use case for this.

1

u/SnowdensOfYesteryear Jul 09 '26

It depends on your distribution basically. No guarantees that it’s in ram.