xref: /netbsd-src/sbin/mount_tmpfs/mount_tmpfs.8 (revision 987ddf0a229d7fddb4de208b13925d5cfca73621)
1.\"	$NetBSD: mount_tmpfs.8,v 1.8 2005/12/24 13:02:53 jmmv Exp $
2.\"
3.\" Copyright (c) 2005 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.\" 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.\"
38.Dd December 24, 2005
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
55The
56.Nm
57command attaches an instance of the efficient memory file system to the
58global file system namespace.
59The directory specified by
60.Ar mount_point
61is converted to an absolute path before use and its attributes (owner,
62group and mode) are inherited unless explicitly overriden by the options
63described below.
64.Pp
65The following options are supported:
66.Bl -tag -width XoXoptions
67.It Fl g Ar group
68Specifies the group name or GID of the root inode of the file system.
69Defaults to the mount point's GID.
70.It Fl m Ar mode
71Specifies the mode (in octal notation) of the root inode of the file system.
72Defaults to the mount point's mode.
73.It Fl n Ar nodes
74Specifies the maximum number of nodes available to the file system.
75.It Fl o Ar options
76Options are specified with a
77.Fl o
78flag followed by a comma-separated string of options.
79See the
80.Xr mount 8
81man page for possible options and their meanings.
82.It Fl s Ar size
83Specifies the total file system size in bytes.
84If zero is given (the default), the available amount of memory (including
85main memory and swap space) will be used.
86Note that four megabytes are always reserved for the system and cannot
87be assigned to the file system.
88.It Fl u Ar user
89Specifies the user name or UID of the root inode of the file system.
90Defaults to the mount point's UID.
91.El
92.Pp
93Every option that accepts a numerical value as its argument can take a
94trailing
95.Sq b
96to indicate bytes (the default), a trailing
97.Sq k
98to indicate kilobytes, a trailing
99.Sq M
100to indicate megabytes or a trailing
101.Sq G
102to indicate gigabytes.
103Note that both lowercase and uppercase forms of these letters are allowed.
104.Sh EXAMPLES
105The following command mounts a tmpfs instance over the
106.Pa /tmp
107directory, inheriting its owner, group and mode settings:
108.Pp
109.Ic "mount -t tmpfs tmpfs /tmp"
110.Pp
111The following command mounts a tmpfs instance over the
112.Pa /mnt
113directory, setting a 20 megabytes limit in space, owned by the
114.Sq joe
115user and belonging to the
116.Sq users
117group, with a restricted 0700 mode:
118.Pp
119.Ic "mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt"
120.Pp
121See
122.Pa /usr/share/examples/fstab/fstab.ramdisk
123for some examples on how to add tmpfs entries to
124.Pa /etc/fstab .
125.Sh SEE ALSO
126.Xr fstab 5 ,
127.Xr mount 8
128.Sh HISTORY
129The
130.Nm
131utility first appeared in
132.Nx 4.0 .
133.Sh BUGS
134This file system is experimental.
135