2008-04-30 17:10:46 +04:00
|
|
|
.\" $NetBSD: mount_tmpfs.8,v 1.14 2008/04/30 13:10:53 martin Exp $
|
2005-09-10 23:20:48 +04:00
|
|
|
.\"
|
2006-11-11 22:01:30 +03:00
|
|
|
.\" Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
|
2005-09-10 23:20:48 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
2005-09-23 19:36:15 +04:00
|
|
|
.\" by Julio M. Merino Vidal, developed as part of Google's Summer of Code
|
|
|
|
.\" 2005 program.
|
2005-09-10 23:20:48 +04:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2008-02-13 17:21:57 +03:00
|
|
|
.Dd February 13, 2008
|
2005-09-10 23:20:48 +04:00
|
|
|
.Dt MOUNT_TMPFS 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mount_tmpfs
|
|
|
|
.Nd mount an efficient memory file system
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl g Ar group
|
|
|
|
.Op Fl m Ar mode
|
|
|
|
.Op Fl n Ar nodes
|
|
|
|
.Op Fl o Ar options
|
|
|
|
.Op Fl s Ar size
|
|
|
|
.Op Fl u Ar user
|
|
|
|
.Ar tmpfs
|
|
|
|
.Ar mount_point
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command attaches an instance of the efficient memory file system to the
|
|
|
|
global file system namespace.
|
2008-02-13 17:21:57 +03:00
|
|
|
The
|
|
|
|
.Ar tmpfs
|
|
|
|
parameter only exists for compatibility with the other mount commands and
|
|
|
|
is ignored.
|
2005-09-10 23:20:48 +04:00
|
|
|
The directory specified by
|
|
|
|
.Ar mount_point
|
2005-09-25 12:08:12 +04:00
|
|
|
is converted to an absolute path before use and its attributes (owner,
|
|
|
|
group and mode) are inherited unless explicitly overriden by the options
|
|
|
|
described below.
|
2005-09-10 23:20:48 +04:00
|
|
|
.Pp
|
|
|
|
The following options are supported:
|
|
|
|
.Bl -tag -width XoXoptions
|
|
|
|
.It Fl g Ar group
|
|
|
|
Specifies the group name or GID of the root inode of the file system.
|
2005-09-25 12:08:12 +04:00
|
|
|
Defaults to the mount point's GID.
|
2005-09-10 23:20:48 +04:00
|
|
|
.It Fl m Ar mode
|
|
|
|
Specifies the mode (in octal notation) of the root inode of the file system.
|
2005-09-25 12:08:12 +04:00
|
|
|
Defaults to the mount point's mode.
|
2005-09-10 23:20:48 +04:00
|
|
|
.It Fl n Ar nodes
|
2005-09-11 02:28:57 +04:00
|
|
|
Specifies the maximum number of nodes available to the file system.
|
2006-12-19 17:50:49 +03:00
|
|
|
If not specified, the file system chooses a reasonable maximum given its
|
|
|
|
size at mount time, which can be limited with
|
|
|
|
.Fl s .
|
2005-09-10 23:20:48 +04:00
|
|
|
.It Fl o Ar options
|
|
|
|
Options are specified with a
|
|
|
|
.Fl o
|
|
|
|
flag followed by a comma-separated string of options.
|
|
|
|
See the
|
|
|
|
.Xr mount 8
|
|
|
|
man page for possible options and their meanings.
|
|
|
|
.It Fl s Ar size
|
|
|
|
Specifies the total file system size in bytes.
|
|
|
|
If zero is given (the default), the available amount of memory (including
|
|
|
|
main memory and swap space) will be used.
|
|
|
|
Note that four megabytes are always reserved for the system and cannot
|
2005-09-11 02:28:57 +04:00
|
|
|
be assigned to the file system.
|
2005-09-10 23:20:48 +04:00
|
|
|
.It Fl u Ar user
|
|
|
|
Specifies the user name or UID of the root inode of the file system.
|
2005-09-25 12:08:12 +04:00
|
|
|
Defaults to the mount point's UID.
|
2005-09-10 23:20:48 +04:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Every option that accepts a numerical value as its argument can take a
|
|
|
|
trailing
|
|
|
|
.Sq b
|
|
|
|
to indicate bytes (the default), a trailing
|
|
|
|
.Sq k
|
|
|
|
to indicate kilobytes, a trailing
|
|
|
|
.Sq M
|
|
|
|
to indicate megabytes or a trailing
|
|
|
|
.Sq G
|
|
|
|
to indicate gigabytes.
|
2005-09-25 12:11:50 +04:00
|
|
|
Note that both lowercase and uppercase forms of these letters are allowed.
|
2005-09-30 00:54:23 +04:00
|
|
|
.Sh EXAMPLES
|
|
|
|
The following command mounts a tmpfs instance over the
|
|
|
|
.Pa /tmp
|
|
|
|
directory, inheriting its owner, group and mode settings:
|
|
|
|
.Pp
|
|
|
|
.Ic "mount -t tmpfs tmpfs /tmp"
|
|
|
|
.Pp
|
|
|
|
The following command mounts a tmpfs instance over the
|
|
|
|
.Pa /mnt
|
|
|
|
directory, setting a 20 megabytes limit in space, owned by the
|
|
|
|
.Sq joe
|
|
|
|
user and belonging to the
|
|
|
|
.Sq users
|
|
|
|
group, with a restricted 0700 mode:
|
|
|
|
.Pp
|
|
|
|
.Ic "mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt"
|
2005-12-24 16:02:53 +03:00
|
|
|
.Pp
|
|
|
|
See
|
|
|
|
.Pa /usr/share/examples/fstab/fstab.ramdisk
|
|
|
|
for some examples on how to add tmpfs entries to
|
|
|
|
.Pa /etc/fstab .
|
2005-09-10 23:20:48 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr fstab 5 ,
|
2005-09-25 22:27:30 +04:00
|
|
|
.Xr mount 8
|
2005-09-10 23:20:48 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility first appeared in
|
|
|
|
.Nx 4.0 .
|
2006-12-19 17:50:49 +03:00
|
|
|
.Sh BUGS
|
|
|
|
File system meta-data is not pageable.
|
|
|
|
If there is not enough main memory to hold this information, the system may
|
|
|
|
become unstable or very unresponsive because it will not be able to allocate
|
|
|
|
required memory.
|
2007-01-03 11:39:29 +03:00
|
|
|
A malicious user could trigger this condition if he could create lots of
|
2006-12-19 17:50:49 +03:00
|
|
|
files inside a size-unbounded tmpfs file system.
|
|
|
|
Limiting the number of nodes per file system
|
2006-12-19 23:33:35 +03:00
|
|
|
.Pq Fl n
|
2006-12-19 17:50:49 +03:00
|
|
|
will prevent this; the default value for this setting is also often adjusted
|
|
|
|
to an adequate value to resolve this.
|