I have a swap of 64 GB SSD. So is there a way to make /tmp mounted as tmpfs to use swap alone and not use RAM?
Asked
Active
Viewed 514 times
-1
-
4Sounds like too much work. Besides, tmpfs will automatically be swapped out if necessary, so you don't need to do anything. If this isn't sufficient, why not just put `/tmp` on the SSD? – Michael Hampton Aug 20 '15 at 04:51
-
4Uhm... tmpfs entirely on swap is generally called "a disk partition". – womble Aug 20 '15 at 05:53
-
@womble Actually not. That will also get cached in memory. – kasperd Aug 21 '15 at 08:32
-
That is true. Not using RAM is actually rather tricky on a computer system... – womble Aug 21 '15 at 21:54
1 Answers
10
I'm not quite clear what you're asking. tmpfs is an in-memory filesystem but you apparently don't want the contents of /tmp
to actually reside in memory, is that right?
Then you simply don't use tmpfs and instead use an ordinary on-disk /tmp
directory or dedicated partition with a normal file-system.

HBruijn
- 77,029
- 24
- 135
- 201
-
2It might be added that even a mounted disk filesystem will take up some memory by using the block cache. – Tilman Schmidt Aug 20 '15 at 07:21