|MOUNT_TMPFS(8)||System Manager's Manual||MOUNT_TMPFS(8)|
mount an efficient memory file system
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:
-oflag followed by a comma-separated string of options. See the mount(8) man page for possible options and their meanings.
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.
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
mount_tmpfs utility first appeared in
NetBSD 4.0 and OpenBSD
The update of mount options (through mount -u) is currently not supported.
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. A
malicious user could trigger this condition by creating lots of files inside
a size-unbounded tmpfs file system. Limiting the number of nodes per file
-n) will prevent this; the default value for
this setting is also often adjusted to an adequate value to resolve
|February 18, 2022||OpenBSD-current|