←back to thread

62 points hiAndrewQuinn | 1 comments | | HN request time: 0.225s | source
Show context
hackyhacky ◴[] No.44392515[source]
Rather than re-write your scripts to store temp files into /dev/shm, you can just mount /tmp using the tmpfs file system and get the same benefit for all your programs. Some distros do this by default.

The relevant line from fstab is:

    tmpfs /tmp            tmpfs    noatime 0       2
Now any program that writes to /tmp will be writing to a RAM disk, thus sparing unnecessary wear on my SSD.
replies(7): >>44392526 #>>44392690 #>>44392745 #>>44392789 #>>44392847 #>>44393129 #>>44393836 #
hiAndrewQuinn ◴[] No.44392526[source]
I do mention this offhand in the article: "The existence of /dev/shm is a boon for me mostly because it means I never have to worry about whether /tmp is really RAM-based again."
replies(2): >>44392561 #>>44392655 #
frollogaston ◴[] No.44392655[source]
"virtually every Unix system already has it mounted as a tmpfs by default" might be true if you say Linux instead, but Mac doesn't have /dev/shm
replies(3): >>44392705 #>>44392793 #>>44392859 #
1. hiAndrewQuinn ◴[] No.44392793[source]
Mea culpa, you're right. I should not have assumed that just because POSIX was mentioned in the orbit of this thing that everyone else had this too.

The article has been corrected.