Hacker News new | ask | show | jobs
by ranger_danger 783 days ago
I can't think of anything _exactly_ like that, but I think you can get close by just copying some type of image file to /tmp and then moving it to disk when you're done after unmounting.
1 comments

/tmp isn't stored in memory; it's usually a normal on-disk filesystem that's cleared regularly. You want /dev/shm instead, which is a purely in-memory filesystem on normal Linux systems.
> /tmp isn't stored in memory

It is if your system uses tmpfs for /tmp

https://en.wikipedia.org/wiki/Tmpfs

The point they were trying to make is that it doesn't have to be, and it isn't in several of the Linux systems I've used over the years. Assuming that it is is a bad idea.
/dev/shm always is though