Hubbry Logo
search
logo
Tmpfs
Tmpfs
current hub

Tmpfs

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Tmpfs

tmpfs (short for temporary file system) is a temporary file storage paradigm implemented in many Unix-like operating systems. It is intended to appear as a mounted file system, but data is stored in volatile memory instead of a persistent storage device.

The idea behind tmpfs is similar in concept to a RAM disk, in that both provide a file system stored in volatile memory; however, the implementations are different. While tmpfs is implemented at the logical file system layer, a RAM disk is implemented at the physical file system layer. In other words, a RAM disk is a virtual block device with a normal file system running on top of it, while tmpfs is a virtual file system without any underlying block device.

Everything stored in tmpfs is temporary in the sense that no files will be directly created on non-volatile storage such as a hard drive (although swap space is used as backing store according to the page replacement policy of the operating system). On reboot, everything in tmpfs will be lost.

The memory used by tmpfs grows and shrinks to accommodate the files it contains.

Many Unix distributions enable and use tmpfs by default for the /tmp branch of the file system or for shared memory. This can be observed with df as in this example:

Some Linux distributions (e.g. Debian until Debian 13) do not have a tmpfs mounted on /tmp by default; in this case, files under /tmp will be stored in the same file system as /.

And on almost all Linux distributions, a tmpfs is mounted on /run/ or /var/run/ to store temporary run-time files such as PID files and Unix domain sockets.

There are several independent variants of the tmpfs concept. One of the earliest was developed by Sun Microsystems for SunOS, and other operating systems like the BSDs and Linux provided their own.

See all
User Avatar
No comments yet.