xref: /dflybsd-src/share/man/man5/tmpfs.5 (revision c616d3786462c4bbb32602d276dfb62c4d97ef77)
17a2de9a4SMatthew Dillon.\"
27a2de9a4SMatthew Dillon.\" Copyright (c) 2007 Xin LI
37a2de9a4SMatthew Dillon.\" All rights reserved.
47a2de9a4SMatthew Dillon.\"
57a2de9a4SMatthew Dillon.\" Redistribution and use in source and binary forms, with or without
67a2de9a4SMatthew Dillon.\" modification, are permitted provided that the following conditions
77a2de9a4SMatthew Dillon.\" are met:
87a2de9a4SMatthew Dillon.\" 1. Redistributions of source code must retain the above copyright
97a2de9a4SMatthew Dillon.\"    notice, this list of conditions and the following disclaimer.
107a2de9a4SMatthew Dillon.\" 2. Redistributions in binary form must reproduce the above copyright
117a2de9a4SMatthew Dillon.\"    notice, this list of conditions and the following disclaimer in the
127a2de9a4SMatthew Dillon.\"    documentation and/or other materials provided with the distribution.
137a2de9a4SMatthew Dillon.\" 3. The name of the author may not be used to endorse or promote products
147a2de9a4SMatthew Dillon.\"    derived from this software without specific prior written permission
157a2de9a4SMatthew Dillon.\"
167a2de9a4SMatthew Dillon.\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
177a2de9a4SMatthew Dillon.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
187a2de9a4SMatthew Dillon.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
197a2de9a4SMatthew Dillon.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
207a2de9a4SMatthew Dillon.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
217a2de9a4SMatthew Dillon.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
227a2de9a4SMatthew Dillon.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
237a2de9a4SMatthew Dillon.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
247a2de9a4SMatthew Dillon.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
257a2de9a4SMatthew Dillon.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
267a2de9a4SMatthew Dillon.\"
277a2de9a4SMatthew Dillon.\" $FreeBSD: src/share/man/man5/tmpfs.5,v 1.7 2010/01/29 15:11:50 jh Exp $
287a2de9a4SMatthew Dillon.\"
297a2de9a4SMatthew Dillon.Dd February 2, 2010
307a2de9a4SMatthew Dillon.Dt TMPFS 5
317a2de9a4SMatthew Dillon.Os
327a2de9a4SMatthew Dillon.Sh NAME
337a2de9a4SMatthew Dillon.Nm tmpfs
347a2de9a4SMatthew Dillon.Nd "efficient memory file system"
357a2de9a4SMatthew Dillon.Sh SYNOPSIS
367a2de9a4SMatthew DillonTo compile this driver into the kernel,
377a2de9a4SMatthew Dillonplace the following line in your
387a2de9a4SMatthew Dillonkernel configuration file:
397a2de9a4SMatthew Dillon.Bd -ragged -offset indent
407a2de9a4SMatthew Dillon.Cd "options TMPFS"
417a2de9a4SMatthew Dillon.Ed
427a2de9a4SMatthew Dillon.Pp
437a2de9a4SMatthew DillonAlternatively, to load the driver as a
447a2de9a4SMatthew Dillonmodule at boot time, place the following line in
457a2de9a4SMatthew Dillon.Xr loader.conf 5 :
467a2de9a4SMatthew Dillon.Bd -literal -offset indent
477a2de9a4SMatthew Dillontmpfs_load="YES"
487a2de9a4SMatthew Dillon.Ed
497a2de9a4SMatthew Dillon.Sh OPTIONS
507a2de9a4SMatthew DillonThe following options are available when
517a2de9a4SMatthew Dillonmounting
527a2de9a4SMatthew Dillon.Nm
537a2de9a4SMatthew Dillonfile systems:
547a2de9a4SMatthew Dillon.Bl -tag -width indent
557a2de9a4SMatthew Dillon.It Cm gid
567a2de9a4SMatthew Dillonroot group id.
577a2de9a4SMatthew Dillon.It Cm uid
587a2de9a4SMatthew Dillonroot user id.
597a2de9a4SMatthew Dillon.It Cm mode
607a2de9a4SMatthew Dillonpermissions in octal format.
617a2de9a4SMatthew Dillon.It Cm inodes
627a2de9a4SMatthew Dillonmaximum number of inodes.
637a2de9a4SMatthew Dillon.It Cm size
64817a2fd9SMatthew Dillonmaximum size for the file system.
657a2de9a4SMatthew Dillon.It Cm maxfilesize
66817a2fd9SMatthew Dillonmaximum file size of the file system.
677a2de9a4SMatthew Dillon.El
68d7be93f6SMatthew Dillon.Sh DESCRIPTION
69d7be93f6SMatthew DillonIn the
70d7be93f6SMatthew Dillon.Dx
71d7be93f6SMatthew Dillonimplementation,
72d7be93f6SMatthew Dillon.Nm
73d7be93f6SMatthew Dillonfilesystems are backed by swap space.
74d7be93f6SMatthew DillonOnly memory pressure will cause data to be backed to swap.
754041d919SSascha WildnerNormal filesystem operations such as
764041d919SSascha Wildner.Fn fsync ,
774041d919SSascha Wildnerbuffer cache flushing, and vnode recycling have no effect.
78d7be93f6SMatthew Dillon.Pp
79d7be93f6SMatthew Dillon.Nm
803da63b93SSascha Wildnerstores meta-data in wired kernel memory.
813da63b93SSascha WildnerMeta-data is not backed by swap so care must be taken if using
82d7be93f6SMatthew Dillon.Nm
83d7be93f6SMatthew Dillonto store large numbers of small files.
84d7be93f6SMatthew Dillon.Pp
85d7be93f6SMatthew DillonIt is recommended that a large amount of swap space be reserved on modern
86d7be93f6SMatthew Dillon.Dx
873da63b93SSascha Wildnerplatforms to accommodate
88d7be93f6SMatthew Dillon.Nm
89d7be93f6SMatthew Dillonand other subsystems.
903da63b93SSascha Wildner32-bit kernels can accommodate 32G of swap by default while 64-bit kernels
913da63b93SSascha Wildnercan accommodate 512G of swap by default.
92d7be93f6SMatthew DillonThese defaults can be increased though it should be noted that 32-bit
93d7be93f6SMatthew Dillonkernels are ultimately limited by the amount of KVM available in its
94d7be93f6SMatthew Dillonsmall 32-bit address space.
95d7be93f6SMatthew Dillon.Pp
96d7be93f6SMatthew Dillon.Nm
97d7be93f6SMatthew Dillonwill allocate and deallocate swap backing store on the fly based on usage.
98d7be93f6SMatthew DillonBy default
99d7be93f6SMatthew Dillon.Nm
100d7be93f6SMatthew Dillonallows up to 100% of swap space to be used.
1013da63b93SSascha WildnerIf this is not desirable then the size option should be used to limit
102d7be93f6SMatthew Dillonits size.
103817a2fd9SMatthew Dillon.Pp
104817a2fd9SMatthew DillonEvery option that accepts a numerical value as its argument can take a
105817a2fd9SMatthew Dillontrailing
106817a2fd9SMatthew Dillon.Sq b
107817a2fd9SMatthew Dillonto indicate bytes (the default), a trailing
108817a2fd9SMatthew Dillon.Sq k
109817a2fd9SMatthew Dillonto indicate kilobytes, a trailing
110817a2fd9SMatthew Dillon.Sq M
111817a2fd9SMatthew Dillonto indicate megabytes or a trailing
112817a2fd9SMatthew Dillon.Sq G
113817a2fd9SMatthew Dillonto indicate gigabytes.
114817a2fd9SMatthew DillonNote that both lowercase and uppercase forms of these letters are allowed.
1157a2de9a4SMatthew Dillon.Sh EXAMPLES
1167a2de9a4SMatthew DillonTo mount a
1177a2de9a4SMatthew Dillon.Nm
1187a2de9a4SMatthew Dillonmemory file system:
1197a2de9a4SMatthew Dillon.Pp
1207a2de9a4SMatthew Dillon.Dl "mount -t tmpfs tmpfs /tmp"
1217a2de9a4SMatthew Dillon.Sh SEE ALSO
1227a2de9a4SMatthew Dillon.Xr fstab 5 ,
123bd740fccSThomas Nikolajsen.Xr mount_nfs 8 ,
12401fc2a18SSascha Wildner.Xr mount_tmpfs 8 ,
125d7be93f6SMatthew Dillon.Xr swapcache 8
1267a2de9a4SMatthew Dillon.Sh HISTORY
1277a2de9a4SMatthew DillonThe
1287a2de9a4SMatthew Dillon.Nm
1297a2de9a4SMatthew Dillondriver first appeared in
1301dfbc7b8SSascha Wildner.Dx 2.5 .
1317a2de9a4SMatthew Dillon.Sh AUTHORS
1327a2de9a4SMatthew Dillon.An -nosplit
1337a2de9a4SMatthew DillonThe
1347a2de9a4SMatthew Dillon.Nm
1357a2de9a4SMatthew Dillonkernel implementation was written by
136*c616d378SFranco Fichtner.An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org
1377a2de9a4SMatthew Dillonas a Google SoC project.
1387a2de9a4SMatthew Dillon.Pp
1397a2de9a4SMatthew Dillon.An Rohit Jalan
1407a2de9a4SMatthew Dillonand others ported it from
1417a2de9a4SMatthew Dillon.Nx
1427a2de9a4SMatthew Dillonto
1437a2de9a4SMatthew Dillon.Fx .
1447a2de9a4SMatthew Dillon.Pp
1457a2de9a4SMatthew Dillon.An Naoya Sugioka
1467a2de9a4SMatthew Dillonand others ported it from
1477a2de9a4SMatthew Dillon.Nx
1487a2de9a4SMatthew Dillonto
1497a2de9a4SMatthew Dillon.Dx .
1507a2de9a4SMatthew Dillon.Pp
1517a2de9a4SMatthew DillonThis manual page was written by
152*c616d378SFranco Fichtner.An Xin LI Aq Mt delphij@FreeBSD.org .
1537a2de9a4SMatthew Dillon.Sh BUGS
154bd740fccSThomas NikolajsenTo mount NFS exported
155bd740fccSThomas Nikolajsen.Nm
156bd740fccSThomas Nikolajsen.Dx
157bd740fccSThomas NikolajsenNFS client need to disable ReaddirPlus, see
158bd740fccSThomas Nikolajsen.Xr mount_nfs 8 .
159