Debian Codegraph @

upstream/debian-trixie/man5/tmpfs-config.5

raw
1 .TH tmpfs-config 5 "18 Feb 2012" "" "Debian Administrator's Manual"
2 .SH NAME
3 tmpfs-config \- variables that configure tmpfs filesystems mounted during boot
4 .SH DESCRIPTION
5 The
6 .I /etc/default/tmpfs
7 file contains variable settings in POSIX format:
8 .IP "" .5i
9 VAR=VAL
10 .PP
11 Only one assignment is allowed per line.
12 Comments (starting with '#') are also allowed.
13 .PP
14 This file is for the configuration of tmpfs filesystems mounted in
15 early boot, before filesystems from /etc/fstab are mounted. This
16 currently includes the filesystems /run, /run/lock, /run/shm and /tmp.
17 /run is required to be a tmpfs on systems supporting tmpfs mounts.
18 /run/lock and /run/shm may be separate tmpfs mounts, useful for
19 enforcing separate size limits. /tmp is not required to be a tmpfs,
20 and is not mounted as a tmpfs by default.
21 .PP
22
23 .IP /run
24 Previously configured using \fBRAMRUN\fP in /etc/default/rcS, /run is
25 now always mounted as a ram file system (tmpfs). The size of the
26 tmpfs can be controlled using TMPFS_SIZE and RUN_SIZE. If desired,
27 the defaults may also be overridden with an entry in in /etc/fstab,
28 for example:
29
30 .EX
31 tmpfs /run tmpfs nodev,nosuid,size=10%,mode=755 0 0
32 .EE
33
34 .IP
35 The contents of /run will always be lost on system reboot, and it it
36 is no longer explicitly cleaned at boot. Packages can not expect
37 directories in /run to exist after boot. Packages expecting this are
38 buggy and need to be fixed. Note that /run was previously /var/run,
39 and a compatibility symlink or bind mount will be created to allow the
40 old path to continue to function.
41
42 .IP /run/lock
43 Previously configured using \fBRAMLOCK\fP in /etc/default/rcS.
44 Configured using RAMLOCK, TMPFS_SIZE and LOCK_SIZE. If desired,
45 the defaults may also be overridden with an entry in in /etc/fstab,
46 for example:
47
48 .EX
49 tmpfs /run/lock tmpfs nodev,noexec,nosuid,size=52428800,mode=1777 0 0
50 .EE
51
52 .IP
53 Note that irrespective of these settings, /run/lock will be located on
54 a tmpfs, either one mounted on /run/lock (if RAMLOCK=yes) or one
55 mounted on /run (if RAMLOCK=no), and as a result the contents of
56 /var/lock will always be lost on system reboot, and it it is no longer
57 explicitly cleaned at boot. Packages can not expect directories in
58 /var/lock to exist after boot. Packages expecting this are buggy and
59 need to be fixed. Note that /run/lock was previously /var/lock, and a
60 compatibility symlink or bind mount will be created to allow the old
61 path to continue to function.
62
63 .IP /run/shm
64 Previously configured using \fBRAMSHM\fP in /etc/default/rcS. Note
65 that the setting in /etc/default/rcS, if present, will still be used,
66 but the setting in /etc/default/tmpfs will take precedence if enabled.
67 Configured using RAMSHM, TMPFS_SIZE and SHM_SIZE. If desired, the
68 defaults may also be overridden with an entry in in /etc/fstab, for
69 example:
70
71 .EX
72 tmpfs /run/shm tmpfs nosuid,nodev,size=40%,mode=1777 0 0
73 .EE
74
75 .IP
76 Packages can not expect directories in /run/shm to exist after boot.
77 Note that /run/shm was previously /dev/shm, and a compatibility
78 symlink or bind mount will be created to allow the old path to
79 continue to function. If an fstab entry for /dev/shm exists instead
80 of /run/shm, then /dev/shm will continue to be used; note that this is
81 only needed for users of newer versions of the Oracle database, which
82 contain a buggy check for /dev/shm.
83
84 .IP /tmp
85 Previously configured using \fBRAMTMP\fP in /etc/default/rcS. Note
86 that the setting in /etc/default/rcS, if present, will still be used,
87 but the setting in /etc/default/tmpfs will take precedence if enabled.
88 Configured using RAMTMP, TMPFS_SIZE and TMP_SIZE. If desired, the
89 defaults may also be overridden with an entry in in /etc/fstab, for
90 example:
91
92 .EX
93 tmpfs /tmp tmpfs nodev,nosuid,size=20%,mode=1777 0 0
94 .EE
95
96 .IP
97 Packages can not expect directories in /tmp to exist after boot.
98
99 .PP
100 \fBNOTE: This file is ignored when systemd is used as init system.\fP
101
102 .SH OPTIONS
103 The following variables can be set.
104
105 .SS Enabling or disabling tmpfs mounts
106
107 .PP
108 The following options enable specific mounts (with the exception of
109 /run) to be enabled or disabled. Note that the addition of an entry
110 to /etc/fstab for any of the following will enable the mount
111 unconditionally, overriding the setting here.
112
113 .IP \fBRAMLOCK\fP
114 Mount /run/lock as a tmpfs (separately from /run). Defaults to
115 \fByes\fP; set to \fBno\fP to disable (/run/lock will then be part of
116 the /run tmpfs, if available).
117
118 .IP \fBRAMSHM\fP
119 Mount /run/shm as a tmpfs (separately from /run). Defaults to
120 \fByes\fP; set to \fBno\fP to disable (/run/shm will then be part of
121 the /run tmpfs, if available).
122
123 .IP \fBRAMTMP\fP
124 Mount /tmp as a tmpfs. Defaults to \fBno\fP; set to \fByes\fP to
125 enable (/tmp will be part of the root filesystem if disabled). /tmp
126 may also be configured to be a separate mount in /etc/fstab, which
127 will override the RAMTMP setting.
128
129 .SS Configuring size limits for tmpfs mounts
130
131 .PP
132 The following options configure size limits for tmpfs mounts. Note
133 that the addition of an entry to /etc/fstab will override any of the
134 limits specified here.
135 .PP
136 The following _SIZE variables are the maximum size (in bytes) that
137 tmpfs filesystems can use. The size will be rounded down to a
138 multiple of the page size, 4096 bytes. If no size is set, TMPFS_SIZE
139 will be used as the default.
140 .PP
141 More complex mount options may be used by the creation of a
142 suitable entry in /etc/fstab. For example:
143
144 .EX
145 tmpfs /run tmpfs size=10% 0 0
146 .EE
147
148 is equivalent to
149
150 .EX
151 RUN_SIZE=10%
152 .EE
153
154 and will override the RUN_SIZE setting. This will allow additional
155 options such as nr_blocks and nr_inodes to be used, and also
156 adjustment of the mode, nodev, nosuid, noexec options should any
157 change from the defaults be necessary.
158
159 .IP "\fBTMPFS_SIZE\fP"
160 Maximum size for all tmpfs filesystems if no specific size is
161 provided. The default is \fB20%VM\fP (20% of virtual memory,
162 including swap space). If this is explicitly set to an empty string, the
163 kernel default (50% RAM) will be used. Note that the "%VM" suffix may be
164 used in this and all the _SIZE settings below, but may not be used in
165 /etc/fstab (the absolute size is calculated by the init scripts).
166
167 .IP "\fBRUN_SIZE\fP"
168 Maximum size of /run (was previously /var/run). The default is 10%
169 core memory; the size required varies widely depending upon the
170 demands of the software being run; this heuristic scales /run usage on
171 system size. Samba in particular has been seen to use at least 50MiB
172 in a large heavily used server. Typical usage is hundreds of KiB,
173 maximum is tens of MiB.
174
175 .IP "\fBLOCK_SIZE\fP"
176 Maximum size of /run/lock (was previously /var/lock). Defaults to
177 5242880 (5 MiB). Typical usage: tens of KiB; maximum hundreds of KiB.
178 The default of 5 MiB should ensure the limit is never reached.
179
180 .IP "\fBSHM_SIZE\fP"
181 Maximum size of /run/shm (was previously /dev/shm). No default size;
182 the size required varies widely depending upon the demands of the
183 software being run.
184
185 .IP "\fBTMP_SIZE\fP"
186 Maximum size of /tmp. No default size.
187
188 .SS Emergency overflow /tmp
189
190 .PP
191 If the amount of free space on the root filesystem falls below a
192 certain size, a tmpfs will be mounted on /tmp (irrespective of the
193 RAMTMP setting, which this overrides). This is to permit logins when
194 there would otherwise be too little free space for this to be possible.
195
196 .IP "\fBTMP_OVERFLOW_LIMIT\fP"
197 Mount a tmpfs on /tmp if the amount of free space on the root
198 filesystem is below the specified limit at boot time (default 1024
199 KiB).
200
201 .SH AUTHOR
202 Roger Leigh <[email protected]>
203
204 .SH SEE ALSO
205 .BR rcS (5),
206 .BR tmpfs (5),
207 .BR mount (8).