1TMPFS(5) Linux Programmer's Manual TMPFS(5)
2
3
4
6 tmpfs - a virtual memory filesystem
7
9 The tmpfs facility allows the creation of filesystems whose contents
10 reside in virtual memory. Since the files on such filesystems typi‐
11 cally reside in RAM, file access is extremely fast.
12
13 The filesystem is automatically created when mounting a filesystem with
14 the type tmpfs via a command such as the following:
15
16 $ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs
17
18 A tmpfs filesystem has the following properties:
19
20 * The filesystem can employ swap space when physical memory pressure
21 demands it.
22
23 * The size option can be used to specify an upper limit on the size of
24 the filesystem. (The default size is half of the available RAM
25 size.) The filesystem consumes only as much physical memory and
26 swap space as is required to store the current contents of the
27 filesystem.
28
29 * During a remount operation (mount -o remount), the filesystem size
30 can be changed (without losing the existing contents of the filesys‐
31 tem).
32
33 If a tmpfs filesystem is unmounted, its contents are discarded (lost).
34
36 The tmpfs facility was added in Linux 2.4, as a successor to the older
37 ramfs facility, which did not provide limit checking or allow for the
38 use of swap space.
39
41 For a description of the mount options that may be employed when mount‐
42 ing a tmpfs filesystem, see mount(8).
43
44 In order for user-space tools and applications to create tmpfs filesys‐
45 tems, the kernel must be configured with the CONFIG_TMPFS option.
46
47 The tmpfs filesystem supports extended attributes (see xattr(7)), but
48 user extended attributes are not permitted.
49
50 An internal shared memory filesystem is used for System V shared memory
51 (shmget(2)) and shared anonymous mappings (mmap(2) with the MAP_SHARED
52 and MAP_ANONYMOUS flags). This filesystem is available regardless of
53 whether the kernel was configured with the CONFIG_TMPFS option.
54
55 A tmpfs filesystem mounted at /dev/shm as used for the implementation
56 of POSIX shared memory (shm_overview(7)) and POSIX semaphores
57 (sem_overview(7)).
58
59 The amount of memory consumed by all tmpfs filesystems is shown in the
60 Shmem field of /proc/meminfo and in the shared field displayed by
61 free(1).
62
63 The tmpfs facility was formerly called shmfs.
64
66 df(1), du(1), memfd_create(2), mmap(2), shm_open(3), mount(8)
67
68 The kernel source file Documentation/filesystems/tmpfs.txt.
69
71 This page is part of release 4.15 of the Linux man-pages project. A
72 description of the project, information about reporting bugs, and the
73 latest version of this page, can be found at
74 https://www.kernel.org/doc/man-pages/.
75
76
77
78Linux 2017-05-03 TMPFS(5)