Is a RAM-Drive backed by a "normal" partition possible?

This is actually not fedora-specific, but since I use fedora I thought I’d ask here.

The problem:
So I have very rw-intensive jobs running on my server basically killing my SSD.

The Server has 128 GB RAM which is largely unsused (~5GB actually in use).
90% of the time those rw-intensive jobs are using less than 10GB of space, so it would be easy to point the application to a RAM-Drive.

Sadly there are rare instances in which it needs more space, in which case the process would fill up the RAM-Disk and crash.

What I already thought of

Using mergerfs (or something simmilar) to combine a RAM-Drive and a subfolder on the SSD, pointing the application there.

It might work but be suboptimal, since it removes the ability to watch changes effectively (I don’t know how the application reacts if the system doesn’t notify about changes anymore).
I know some applications had problems with it when I used it for other purpouses before.

My Goal is not to make access faster but to lessen the (unnecessary) writes on the SSDs since if it wasn’t for this I wouldn’t even need enterprise grade SSDs and could get away with using consumer-grade.

I think we use tmpfs on /tmp by default already, so you should be able to just increase the size there as you need and then use that for your rw jobs? The caveat of course is that /tmp will be cleaned on each boot.

https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html

https://fedoraproject.org/wiki/Features/tmp-on-tmpfs

Would this do?

1 Like

Yeah, the thing I can’t figure out is how to define a swap for the tmpfs since I need it to be bigger than my RAM. (/tmp is actually limited to 0.5xRAM-size by default)

RAMdisks are always cleaned on reboot, so thats not really a caveat…

Hrm, I think you just create a separate swap partition as we traditionally do—I didn’t think it’ll have to be specifically for the tmpfs? Did you find some docs that indicate this needs to be done?