Interview Prep/Linux/Filesystem Hierarchy, Inodes & Links

What is a tmpfs and when is it used?

IntermediateConceptFilesystem Hierarchy, Inodes & Links
Answer

tmpfs is a filesystem that lives in the page cache (RAM, and can be swapped). It is used for /run, /dev/shm and often /tmp. Contents vanish on reboot. Limit it with size=:

sudo mount -t tmpfs -o size=512m tmpfs /mnt/scratch
df -h /dev/shm

Data written to tmpfs counts as shared memory (Shmem in /proc/meminfo), not as free memory.

All Linux questions Roadmap: Linux

More on Filesystem Hierarchy, Inodes & Links