this post was submitted on 16 Feb 2025
24 points (100.0% liked)
Rust
6403 readers
22 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
On Linux you can use tmpfs
/tmp
is stilltmpfs
here, but I prefer this (below) nowadays for usages that are not typical/tmp
usages:This is a part of my zram devices initialization script, a bunch used for swap as usual, then ending with this.
modprobe zram num_devices=0
works if one likes tohot_add
all devices.From zram you get a block device with builtin compression. From ext4, you still get features like creation time, truncate and fallocate support, ...etc. And with discard, ram usage will be limited to used space (like tmpfs). Also ext4 is used without a journal to avoid what would be useless overhead in this use-case.