kernel: bwrite_common's 3rd & 4th args can be bools
[unleashed.git] / share / man / man7fs / tmpfs.7fs
blobf56a24497d2d9bc910ca7bb1eb47242c679a4dbf
1 '\" te
2 .\" Copyright (c) 1990, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TMPFS 7FS "Oct 9, 1990"
7 .SH NAME
8 tmpfs \- memory based file system
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/mount.h>
14 \fB\fR\fBmount\fR (\fB\fR\fIspecial\fR, \fB\fR\fIdirectory\fR, \fB\fR\fIMS_DATA\fR, \fB\fR\fI"tmpfs"\fR, \fB\fR\fINULL\fR, \fB\fR\fI0\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 \fBtmpfs\fR is a memory based file system which uses kernel resources relating
21 to the \fBVM\fR system and page cache as a file system. Once mounted, a
22 \fBtmpfs\fR file system provides standard file operations and semantics.
23 \fBtmpfs\fR is so named because files and directories are not preserved across
24 reboot or unmounts, all files residing on a  \fBtmpfs\fR file system that is
25 unmounted will be lost.
26 .sp
27 .LP
28 \fBtmpfs\fR file systems can be mounted with the command:
29 .sp
30 .in +2
31 .nf
32 \fBmount \fR\fB-F\fR\fB tmpfs swap \fR\fIdirectory\fR
33 .fi
34 .in -2
36 .sp
37 .LP
38 Alternatively, to mount a  \fBtmpfs\fR file system on \fB/tmp\fR at multi-user
39 startup time (maximizing possible performance improvements), add the following
40 line to \fB/etc/vfstab\fR:
41 .sp
42 .in +2
43 .nf
44 \fBswap \(mi/tmp tmpfs \(mi yes \(mi\fR
45 .fi
46 .in -2
48 .sp
49 .LP
50 \fBtmpfs\fR is designed as a performance enhancement which is achieved by
51 caching the writes to files residing on a  \fBtmpfs\fR file system. Performance
52 improvements are most noticeable when a large number of short lived files are
53 written and accessed on a \fBtmpfs\fR file system. Large compilations with
54 \fBtmpfs\fR mounted on \fB/tmp\fR are a good example of this.
55 .sp
56 .LP
57 Users of \fBtmpfs\fR should be aware of some constraints involved in mounting a
58 \fBtmpfs\fR file system. The resources used by \fBtmpfs\fR are the same as
59 those used when commands are executed (for example, swap space allocation).
60 This means that  large sized  \fBtmpfs\fR files can affect the amount of space
61 left over for programs to execute. Likewise, programs requiring large amounts
62 of memory use up the space available to \fBtmpfs\fR. Users running into this
63 constraint (for example, running out of space on \fBtmpfs\fR) can allocate more
64 swap space by using the \fBswap\fR(8) command.
65 .sp
66 .LP
67 Another constraint is that the number of files available in a  \fBtmpfs\fR file
68 system is calculated based on the physical memory of the machine  and not the
69 size of the swap device/partition. If you have too many files, \fBtmpfs\fR will
70 print a warning message and you will be unable to create new files. You cannot
71 increase this limit by adding swap space.
72 .sp
73 .LP
74 Normal file system writes are scheduled to be written to a permanent storage
75 medium along with all control information associated with the file (for
76 example, modification time, file permissions). \fBtmpfs\fR control information
77 resides only in memory and never needs to be written to permanent storage. File
78 data remains in core until memory demands are sufficient to cause pages
79 associated with \fBtmpfs\fR to be reused at which time they are copied out to
80 swap.
81 .sp
82 .LP
83 An additional mount option can be specified to control the size of an
84 individual \fBtmpfs\fR file system.
85 .SH SEE ALSO
86 .sp
87 .LP
88 \fBdf\fR(8), \fBmount\fR(8), \fBmount_tmpfs\fR(8), \fBswap\fR(8),
89 \fBmmap\fR(2), \fBmount\fR(2), \fBumount\fR(2), \fBvfstab\fR(4)
90 .sp
91 .LP
92 \fISystem Administration Guide: Basic Administration\fR
93 .SH DIAGNOSTICS
94 .sp
95 .LP
96 If \fBtmpfs\fR runs out of space, one of the following messages will display in
97 the console.
98 .sp
99 .ne 2
101 \fB\fB\fIdirectory\fR: File system full, swap space limit exceeded\fR\fR
103 .sp .6
104 .RS 4n
105 This message appears because a page could not be allocated while writing to a
106 file. This can occur if \fBtmpfs\fR is attempting to write more than it is
107 allowed, or if currently executing programs are using a lot of memory. To make
108 more space available, remove unnecessary files, exit from some programs, or
109 allocate more swap space using \fBswap\fR(8).
113 .ne 2
115 \fB\fB\fIdirectory\fR: File system full, memory allocation failed\fR\fR
117 .sp .6
118 .RS 4n
119 \fBtmpfs\fR ran out of physical memory while attempting to create a new file or
120 directory. Remove unnecessary files or directories or install more physical
121 memory.
124 .SH WARNINGS
127 Files and directories on a \fBtmpfs\fR file system are not preserved across
128 reboots or unmounts. Command scripts or programs which count on this will not
129 work as expected.
130 .SH NOTES
133 Compilers do not necessarily use \fB/tmp\fR to write intermediate files
134 therefore missing some significant performance benefits. This can be remedied
135 by setting the environment variable \fBTMPDIR\fR to \fB/tmp\fR. Compilers use
136 the value in this environment variable as the name of the directory to store
137 intermediate files.
140 \fBswap\fR to a \fBtmpfs\fR file is not supported.
143 \fBdf\fR(8) output is of limited accuracy since a \fBtmpfs\fR file system size
144 is not static and the space available to \fBtmpfs\fR is dependent on the swap
145 space demands of the entire system.