mount_tmpfs8
Mount an efficient memory file system
Usage
mount_tmpfs [-g
group]
[-m
mode]
[-n
nodes]
[-o
options]
[-s
size]
[-u
user]
tmpfs
mount_point
Overview
The mount_tmpfs command attaches an instance of the efficient memory file system to the global file system namespace. The tmpfs parameter only exists for compatibility with the other mount commands and is ignored. The directory specified by mount_point is converted to an absolute path before use and its attributes (owner, group and mode) are inherited unless explicitly overridden by the options described below.
The following options are supported:
-
-g group -
Specifies the group name or GID of the root inode of the file system. Defaults to the mount point's GID.
-
-m mode -
Specifies the mode (in octal notation) of the root inode of the file system. Defaults to the mount point's mode.
-
-n nodes -
Specifies the maximum number of nodes available to the file system. If not specified, the file system chooses a reasonable maximum given its size at mount time, which can be limited with
-s. -
-o options -
Options are specified with a
-oflag followed by a comma-separated string of options. See the mount(8) man page for possible options and their meanings. -
-s 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 be assigned to the file system.
-
-u user -
Specifies the user name or UID of the root inode of the file system. Defaults to the mount point's UID.
Every option that accepts a numerical value as its argument can take a trailing ‘b’ to indicate bytes (the default), a ‘k’ to indicate kilobytes, a ‘M’ to indicate megabytes or a ‘G’ to indicate gigabytes. Note that both lowercase and uppercase forms of these letters are allowed.
Examples
The following command mounts a tmpfs instance over the /tmp directory, inheriting its owner, group and mode settings:
# mount -t tmpfs tmpfs /tmp
The following command mounts a tmpfs instance over the /mnt directory, setting a 20 megabytes limit in space, owned by the ‘joe’ user and belonging to the ‘users’ group, with a restricted 0700 mode:
# mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt
A corresponding fstab(5) entry, using "swap" as a place holder:
swap /mnt tmpfs rw,-s20M,-ujoe,-gusers,-m0700 0 0
Caveats
The update of mount options (through mount -u) is currently not supported.
Releases
27 releases since OpenBSD 5.5; the text changed 2 times.