Section (5) tmpfs
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
tmpfs via a command such as
$ 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 filesystem consumes only as much physical memory and swap space as is required to store the current contents of the filesystem.
During a remount operation (mount −o remount), the filesystem size can be changed (without losing the existing contents of the filesystem).
filesystem is unmounted, its contents are discarded
filesystem supports the following mount options:
Specify an upper limit on the size of the filesystem. The size is given in bytes, and rounded up to entire pages.
The size may have a
gsuffix for Ki, Mi, Gi (binary kilo (kibi), binary mega (mebi) and binary giga (gibi)).
The size may also have a % suffix to limit this instance to a percentage of physical RAM.
The default, when neither
nr_blocksis specified, is
The same as
size, but in blocks of
Blocks may be specified with
size, but not a % suffix.
The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is smaller.
Inodes may be specified with
size, but not a % suffix.
Set initial permissions of the root directory.
gid(since Linux 2.5.7)
Set the initial group ID of the root directory.
uid(since Linux 2.5.7)
Set the initial user ID of the root directory.
huge_option(since Linux 4.7.0)
Set the huge table memory allocation policy for all files in this instance (if
huge_optionvalue is one of the following:
Do not allocate huge pages. This is the default.
Attempt to allocate huge pages every time a new page is needed.
Only allocate huge page if it will be fully within
i_size. Also respect fadvise(2)/madvise(2) hints
Only allocate huge pages if requested with fadvise(2)/madvise(2).
For use in emergencies, to force the huge option off from all mounts.
Force the huge option on for all mounts; useful for testing.
mpol_option(since Linux 2.6.15)
Set the NUMA memory allocation policy for all files in this instance (if
mpol_optionvalue is one of the following:
Use the process allocation policy (see set_mempolicy(2)).
Preferably allocate memory from the given
Allocate memory only from nodes in
Allocate from each node in turn.
Allocate from each node of
Preferably allocate memory from the local node.
In the above,
nodelistis a comma-separated list of decimal numbers and ranges that specify NUMA nodes. A range is a pair of hyphen-separated decimal numbers, the smallest and largest node numbers in the range. For example,
facility was added in Linux 2.4, as a successor to the older
which did not provide limit checking or allow for the use of
In order for user-space tools and applications to create
the kernel must be configured with the
filesystem supports extended attributes (see xattr(7)), but
user extended attributes are
An internal shared memory filesystem is used for System V
shared memory (shmget(2)) and shared
anonymous mappings (mmap(2) with the
MAP_ANONYMOUS flags). This filesystem is
available regardless of whether the kernel was configured
The amount of memory consumed by all
tmpfs filesystems is shown in
Shmem field of
/proc/meminfo and in the
displayed by free(1).
facility was formerly called
The kernel source files
This page is part of release 5.04 of the Linux
man-pages project. A
description of the project, information about reporting bugs,
and the latest version of this page, can be found at
Copyright (c) 2016 by Michael Kerrisk <mtk.manpagesgmail.com>
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Since the Linux kernel and libraries are constantly changing, this
manual page may be incorrect or out-of-date. The author(s) assume no
responsibility for errors or omissions, or for damages resulting from
the use of the information contained herein. The author(s) may not
have taken the same level of care in the production of this manual,
which is licensed free of charge, as they might when working
Formatted or processed versions of this manual, if unaccompanied by
the source, must acknowledge the copyright and authors of this work.