Is it possible to avoid trashing hard disk while using /tmp as a RAM device?
1
vote
1
answer
398
views
# Origin
I need to implement some features to my GDB helper scripts but I have to stick with an older version of GDB (5.3, in this case). Since older versions lack so many features, I need to workaround the required features by redirecting some strings to a file and then
source
them.
# Problem
I don't want to trash my hard disk with intensive amount of temporary files written to /tmp
.
# Assumption
Since my /tmp
folder is mounted with tmpfs
, I assume that it's actually placed on RAM and it's swapped out to swap area when filled:
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=524288k)
# Question
Can I guarantee that any small file (max 30 characters long strings) I wrote into /tmp
(which I'll delete almost immediately) will only live in RAM in its lifetime and won't go into hard disk, even the frequency is as high as 100 writes per second?
Asked by ceremcem
(2451 rep)
Oct 8, 2020, 09:04 AM
Last activity: Sep 11, 2023, 02:51 PM
Last activity: Sep 11, 2023, 02:51 PM