Debian Codegraph @

upstream/debian-unstable/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 presence of an entry in /etc/fstab will override all of the
134 limits specified here in respect of that mountpoint. Either configure
135 a particular tmpfs mountpoint in /etc/fstab or /etc/default/tmpfs,
136 but not both.
137 .PP
138 The following _SIZE variables are the maximum size (in bytes) that
139 tmpfs filesystems can use. The size will be rounded down to a
140 multiple of the page size, 4096 bytes. If no size is set, TMPFS_SIZE
141 will be used as the default.
142 .PP
143 More complex mount options may be used by the creation of a
144 suitable entry in /etc/fstab. For example:
145
146 .EX
147 tmpfs /run tmpfs size=10% 0 0
148 .EE
149
150 is equivalent to
151
152 .EX
153 RUN_SIZE=10%
154 .EE
155
156 and will override the RUN_SIZE setting. This will allow additional
157 options such as nr_blocks and nr_inodes to be used, and also
158 adjustment of the mode, nodev, nosuid, noexec options should any
159 change from the defaults be necessary.
160
161 .IP "\fBTMPFS_SIZE\fP"
162 Maximum size for all tmpfs filesystems if no specific size is
163 provided. The default is \fB20%VM\fP (20% of virtual memory,
164 including swap space). If this is explicitly set to an empty string, the
165 kernel default (50% RAM) will be used. Note that the "%VM" suffix may be
166 used in this and all the _SIZE settings below, but may not be used in
167 /etc/fstab (the absolute size is calculated by the init scripts).
168
169 .IP "\fBRUN_SIZE\fP"
170 Maximum size of /run (was previously /var/run). The default is 10%
171 core memory; the size required varies widely depending upon the
172 demands of the software being run; this heuristic scales /run usage on
173 system size. Samba in particular has been seen to use at least 50MiB
174 in a large heavily used server. Typical usage is hundreds of KiB,
175 maximum is tens of MiB.
176
177 .IP "\fBLOCK_SIZE\fP"
178 Maximum size of /run/lock (was previously /var/lock). Defaults to
179 5242880 (5 MiB). Typical usage: tens of KiB; maximum hundreds of KiB.
180 The default of 5 MiB should ensure the limit is never reached.
181
182 .IP "\fBSHM_SIZE\fP"
183 Maximum size of /run/shm (was previously /dev/shm). No default size;
184 the size required varies widely depending upon the demands of the
185 software being run.
186
187 .IP "\fBTMP_SIZE\fP"
188 Maximum size of /tmp. No default size.
189
190 .SS Emergency overflow /tmp
191
192 .PP
193 If the amount of free space on the root filesystem falls below a
194 certain size, a tmpfs will be mounted on /tmp (irrespective of the
195 RAMTMP setting, which this overrides). This is to permit logins when
196 there would otherwise be too little free space for this to be possible.
197
198 .IP "\fBTMP_OVERFLOW_LIMIT\fP"
199 Mount a tmpfs on /tmp if the amount of free space on the root
200 filesystem is below the specified limit at boot time (default 1024
201 KiB).
202
203 .SH AUTHOR
204 Roger Leigh <[email protected]>
205
206 .SH SEE ALSO
207 .BR rcS (5),
208 .BR tmpfs (5),
209 .BR mount (8).