]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/tmpfs.5
getauxval.3, cciss.4, cpuid.4, msr.4, proc.5, tmpfs.5, man-pages.7, pid_namespaces...
[thirdparty/man-pages.git] / man5 / tmpfs.5
CommitLineData
244b15d4
MK
1.\" Copyright (c) 2016 by Michael Kerrisk <mtk.manpages@gmail.com>
2.\"
3.\" %%%LICENSE_START(VERBATIM)
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\" %%%LICENSE_END
24.\"
734882f4 25.TH TMPFS 5 2017-05-03 "Linux" "Linux Programmer's Manual"
244b15d4
MK
26.SH NAME
27tmpfs \- a virtual memory filesystem
28.SH DESCRIPTION
29The
30.B tmpfs
31facility allows the creation of filesystems whose contents reside
32in virtual memory.
33Since the files on such filesystems typically reside in RAM,
34file access is extremely fast.
35
36The filesystem is automatically created when mounting
37a filesystem with the type
38.BR tmpfs
39via a command such as the following:
019d9ee8
MK
40.PP
41.in +4n
42.EX
43$ sudo mount \-t tmpfs -o size=10M tmpfs /mnt/mytmpfs
44.EE
45.in
46.PP
244b15d4
MK
47A
48.B tmpfs
49filesystem has the following properties:
50.IP * 3
51The filesystem can employ swap space when physical memory pressure
52demands it.
53.IP *
54The
55.I size
56option can be used to specify an upper limit on the size of the filesystem.
57(The default size is half of the available RAM size.)
58The filesystem consumes only as much physical memory and swap space
59as is required to store the current contents of the filesystem.
60.IP *
61During a remount operation
62.RI ( "mount\ \-o\ remount" ),
63the filesystem size can be changed
64(without losing the existing contents of the filesystem).
65.PP
66If a
67.B tmpfs
68filesystem is unmounted, its contents are discarded (lost).
69.SH VERSIONS
70The
71.B tmpfs
72facility was added in Linux 2.4, as a successor to the older
73.B ramfs
74facility, which did not provide limit checking or
75allow for the use of swap space.
76.SH NOTES
77For a description of the mount options that may be employed when mounting a
78.B tmpfs
79filesystem, see
80.BR mount (8).
81
765633a2 82In order for user-space tools and applications to create
244b15d4
MK
83.B tmpfs
84filesystems, the kernel must be configured with the
85.B CONFIG_TMPFS
86option.
87
0d8f84db
MK
88The
89.BR tmpfs
90filesystem supports extended attributes (see
91.BR xattr (7)),
92but
93.I user
94extended attributes are not permitted.
95
244b15d4
MK
96An internal shared memory filesystem is used for
97System V shared memory
690e8267 98.RB ( shmget (2))
244b15d4
MK
99and shared anonymous mappings
100.RB ( mmap (2)
101with the
102.B MAP_SHARED
103and
104.BR MAP_ANONYMOUS
105flags).
106This filesystem is available regardless of whether
107the kernel was configured with the
108.B CONFIG_TMPFS
109option.
110
111A
112.B tmpfs
113filesystem mounted at
114.IR /dev/shm
115as used for the implementation of POSIX shared memory
116.RB ( shm_overview (7))
117and POSIX semaphores
118.RB ( sem_overview (7)).
119
120The amount of memory consumed by all
121.B tmpfs
122filesystems is shown in the
123.I Shmem
124field of
125.IR /proc/meminfo
126and in the
127.I shared
128field displayed by
129.BR free (1).
130
131The
132.B tmpfs
133facility was formerly called
134.BR shmfs .
135.SH SEE ALSO
136.BR df (1),
137.BR du (1),
fe340cde
MK
138.BR memfd_create (2),
139.BR mmap (2),
140.BR shm_open (3),
244b15d4
MK
141.BR mount (8)
142.PP
143The kernel source file
144.IR Documentation/filesystems/tmpfs.txt .