]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/tmpfs.5
pldd.1: ffix
[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:
40
41 $ sudo mount \-t tmpfs -o size=10M tmpfs /mnt/mytmpfs
42
43A
44.B tmpfs
45filesystem has the following properties:
46.IP * 3
47The filesystem can employ swap space when physical memory pressure
48demands it.
49.IP *
50The
51.I size
52option can be used to specify an upper limit on the size of the filesystem.
53(The default size is half of the available RAM size.)
54The filesystem consumes only as much physical memory and swap space
55as is required to store the current contents of the filesystem.
56.IP *
57During a remount operation
58.RI ( "mount\ \-o\ remount" ),
59the filesystem size can be changed
60(without losing the existing contents of the filesystem).
61.PP
62If a
63.B tmpfs
64filesystem is unmounted, its contents are discarded (lost).
65.SH VERSIONS
66The
67.B tmpfs
68facility was added in Linux 2.4, as a successor to the older
69.B ramfs
70facility, which did not provide limit checking or
71allow for the use of swap space.
72.SH NOTES
73For a description of the mount options that may be employed when mounting a
74.B tmpfs
75filesystem, see
76.BR mount (8).
77
765633a2 78In order for user-space tools and applications to create
244b15d4
MK
79.B tmpfs
80filesystems, the kernel must be configured with the
81.B CONFIG_TMPFS
82option.
83
0d8f84db
MK
84The
85.BR tmpfs
86filesystem supports extended attributes (see
87.BR xattr (7)),
88but
89.I user
90extended attributes are not permitted.
91
244b15d4
MK
92An internal shared memory filesystem is used for
93System V shared memory
690e8267 94.RB ( shmget (2))
244b15d4
MK
95and shared anonymous mappings
96.RB ( mmap (2)
97with the
98.B MAP_SHARED
99and
100.BR MAP_ANONYMOUS
101flags).
102This filesystem is available regardless of whether
103the kernel was configured with the
104.B CONFIG_TMPFS
105option.
106
107A
108.B tmpfs
109filesystem mounted at
110.IR /dev/shm
111as used for the implementation of POSIX shared memory
112.RB ( shm_overview (7))
113and POSIX semaphores
114.RB ( sem_overview (7)).
115
116The amount of memory consumed by all
117.B tmpfs
118filesystems is shown in the
119.I Shmem
120field of
121.IR /proc/meminfo
122and in the
123.I shared
124field displayed by
125.BR free (1).
126
127The
128.B tmpfs
129facility was formerly called
130.BR shmfs .
131.SH SEE ALSO
132.BR df (1),
133.BR du (1),
fe340cde
MK
134.BR memfd_create (2),
135.BR mmap (2),
136.BR shm_open (3),
244b15d4
MK
137.BR mount (8)
138.PP
139The kernel source file
140.IR Documentation/filesystems/tmpfs.txt .