manpages: Remove a bunch of unneeded Pp macros.
[dragonfly.git] / sbin / mount_tmpfs / mount_tmpfs.8
1 .\"     $NetBSD: mount_tmpfs.8,v 1.14 2008/04/30 13:10:53 martin Exp $
2 .\"
3 .\" Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Julio M. Merino Vidal, developed as part of Google's Summer of Code
8 .\" 2005 program.
9 .\"
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
12 .\" are met:
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\"    notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\"    notice, this list of conditions and the following disclaimer in the
17 .\"    documentation and/or other materials provided with the distribution.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 .\" POSSIBILITY OF SUCH DAMAGE.
30 .\"
31 .Dd September 18, 2010
32 .Dt MOUNT_TMPFS 8
33 .Os
34 .Sh NAME
35 .Nm mount_tmpfs
36 .Nd mount an efficient memory file system
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl C
40 .Op Fl f Ar maxfilesize
41 .Op Fl g Ar group
42 .Op Fl m Ar mode
43 .Op Fl n Ar nodes
44 .Op Fl o Ar options
45 .Op Fl s Ar size
46 .Op Fl u Ar user
47 .Ar tmpfs
48 .Ar mount_point
49 .Sh DESCRIPTION
50 The
51 .Nm
52 command attaches an instance of the efficient memory file system to the
53 global file system namespace.
54 The
55 .Ar tmpfs
56 parameter only exists for compatibility with the other mount commands and
57 is ignored.
58 The directory specified by
59 .Ar mount_point
60 is converted to an absolute path before use and its attributes (owner,
61 group and mode) are inherited unless explicitly overriden by the options
62 described below.
63 .Pp
64 The following options are supported:
65 .Bl -tag -width XoXoptions
66 .It Fl C
67 Tells
68 .Nm
69 to copy the underlying file system into the tmpfs mount being created
70 over it.
71 .It Fl f Ar maxfilesize
72 Specifies the maximum file size of the file system.
73 .It Fl g Ar group
74 Specifies the group name or GID of the root inode of the file system.
75 Defaults to the mount point's GID.
76 .It Fl m Ar mode
77 Specifies the mode (in octal notation) of the root inode of the file system.
78 Defaults to the mount point's mode.
79 .It Fl n Ar nodes
80 Specifies the maximum number of nodes available to the file system.
81 If not specified, the file system chooses a reasonable maximum given its
82 size at mount time, which can be limited with
83 .Fl s .
84 .It Fl o Ar options
85 Options are specified with a
86 .Fl o
87 flag followed by a comma-separated string of options.
88 See the
89 .Xr mount 8
90 and
91 .Xr tmpfs 5
92 man page for possible options and their meanings.
93 .It Fl s Ar size
94 Specifies the total file system size.
95 If zero is given (the default), the available amount of memory (including
96 main memory and swap space) will be used.
97 Note that four megabytes are always reserved for the system and cannot
98 be assigned to the file system.
99 .It Fl u Ar user
100 Specifies the user name or UID of the root inode of the file system.
101 Defaults to the mount point's UID.
102 .El
103 .Pp
104 Every option that accepts a numerical value as its argument can take a
105 trailing
106 .Sq b
107 to indicate bytes (the default), a trailing
108 .Sq k
109 to indicate kilobytes, a trailing
110 .Sq M
111 to indicate megabytes or a trailing
112 .Sq G
113 to indicate gigabytes.
114 Note that both lowercase and uppercase forms of these letters are allowed.
115 .Sh EXAMPLES
116 The following command mounts a tmpfs instance over the
117 .Pa /tmp
118 directory, inheriting its owner, group and mode settings:
119 .Pp
120 .Ic "mount -t tmpfs tmpfs /tmp"
121 .Pp
122 The following command mounts a tmpfs instance over the
123 .Pa /mnt
124 directory, setting a 20 megabytes limit in space, owned by the
125 .Sq joe
126 user and belonging to the
127 .Sq users
128 group, with a restricted 0700 mode:
129 .Pp
130 .Ic "mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt"
131 .Pp
132 or
133 .Pp
134 .Ic "mount -t tmpfs -o size=20M,uid=joe,gid=users,mode=0700 tmpfs /mnt"
135 .Sh SEE ALSO
136 .Xr fstab 5 ,
137 .Xr tmpfs 5 ,
138 .Xr mount 8
139 .Sh HISTORY
140 The
141 .Nm
142 utility first appeared in
143 .Nx 4.0 .
144 .Sh BUGS
145 File system meta-data is not pageable.
146 If there is not enough main memory to hold this information, the system may
147 become unstable or very unresponsive because it will not be able to allocate
148 required memory.
149 A malicious user could trigger this condition if he could create lots of
150 files inside a size-unbounded tmpfs file system.
151 Limiting the number of nodes per file system
152 .Pq Fl n
153 will prevent this; the default value for this setting is also often adjusted
154 to an adequate value to resolve this.