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