tmpfs - a virtual memory filesystem
facility allows the creation of filesystems whose contents
reside in virtual memory. Since the files on such filesystems typically reside
in RAM, file access is extremely fast.
The filesystem is automatically created when mounting a filesystem with the type
via a command such as the following:
$ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs
filesystem has the following properties:
- The filesystem can employ swap space when physical memory
pressure demands it.
- The size option can be used to specify an upper
limit on the size of the filesystem. (The default size is half of the
available RAM size.) The filesystem consumes only as much physical memory
and swap space as is required to store the current contents of the
- During a remount operation
(mount -o remount), the filesystem size can be
changed (without losing the existing contents of the filesystem).
If a tmpfs
filesystem is unmounted, its contents are discarded (lost).
facility was added in Linux 2.4, as a successor to the older
facility, which did not provide limit checking or allow for the
use of swap space.
For a description of the mount options that may be employed when mounting a
filesystem, see mount(8)
In order for user-space tools and applications to create tmpfs
filesystems, the kernel must be configured with the CONFIG_TMPFS
filesystem supports extended attributes (see xattr(7)
extended attributes are not permitted.
An internal shared memory filesystem is used for System V shared memory
) and shared anonymous mappings (mmap(2)
flags). This filesystem is
available regardless of whether the kernel was configured with the
filesystem mounted at /dev/shm
as used for the
implementation of POSIX shared memory (shm_overview(7)
) and POSIX
The amount of memory consumed by all tmpfs
filesystems is shown in the
field of /proc/meminfo
and in the shared
displayed by free(1)
facility was formerly called shmfs
The kernel source file Documentation/filesystems/tmpfs.txt
This page is part of release 4.14 of the Linux man-pages
description of the project, information about reporting bugs, and the latest
version of this page, can be found at