xref: /dflybsd-src/share/man/man5/tmpfs.5 (revision 817a2fd9202facea9e37e861c90659595b48cdba)
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
64*817a2fd9SMatthew Dillonmaximum size for the file system.
657a2de9a4SMatthew Dillon.It Cm maxfilesize
66*817a2fd9SMatthew 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.
75d7be93f6SMatthew DillonNormal filesystem operations such as fsync(), buffer cache flushing,
76d7be93f6SMatthew Dillonand vnode recycling have no effect.
77d7be93f6SMatthew Dillon.Pp
78d7be93f6SMatthew Dillon.Nm
793da63b93SSascha Wildnerstores meta-data in wired kernel memory.
803da63b93SSascha WildnerMeta-data is not backed by swap so care must be taken if using
81d7be93f6SMatthew Dillon.Nm
82d7be93f6SMatthew Dillonto store large numbers of small files.
83d7be93f6SMatthew Dillon.Pp
84d7be93f6SMatthew DillonIt is recommended that a large amount of swap space be reserved on modern
85d7be93f6SMatthew Dillon.Dx
863da63b93SSascha Wildnerplatforms to accommodate
87d7be93f6SMatthew Dillon.Nm
88d7be93f6SMatthew Dillonand other subsystems.
893da63b93SSascha Wildner32-bit kernels can accommodate 32G of swap by default while 64-bit kernels
903da63b93SSascha Wildnercan accommodate 512G of swap by default.
91d7be93f6SMatthew DillonThese defaults can be increased though it should be noted that 32-bit
92d7be93f6SMatthew Dillonkernels are ultimately limited by the amount of KVM available in its
93d7be93f6SMatthew Dillonsmall 32-bit address space.
94d7be93f6SMatthew Dillon.Pp
95d7be93f6SMatthew Dillon.Nm
96d7be93f6SMatthew Dillonwill allocate and deallocate swap backing store on the fly based on usage.
97d7be93f6SMatthew DillonBy default
98d7be93f6SMatthew Dillon.Nm
99d7be93f6SMatthew Dillonallows up to 100% of swap space to be used.
1003da63b93SSascha WildnerIf this is not desirable then the size option should be used to limit
101d7be93f6SMatthew Dillonits size.
102*817a2fd9SMatthew Dillon.El
103*817a2fd9SMatthew Dillon.Pp
104*817a2fd9SMatthew DillonEvery option that accepts a numerical value as its argument can take a
105*817a2fd9SMatthew Dillontrailing
106*817a2fd9SMatthew Dillon.Sq b
107*817a2fd9SMatthew Dillonto indicate bytes (the default), a trailing
108*817a2fd9SMatthew Dillon.Sq k
109*817a2fd9SMatthew Dillonto indicate kilobytes, a trailing
110*817a2fd9SMatthew Dillon.Sq M
111*817a2fd9SMatthew Dillonto indicate megabytes or a trailing
112*817a2fd9SMatthew Dillon.Sq G
113*817a2fd9SMatthew Dillonto indicate gigabytes.
114*817a2fd9SMatthew 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 ,
12301fc2a18SSascha Wildner.Xr mount_tmpfs 8 ,
124d7be93f6SMatthew Dillon.Xr swapcache 8
1257a2de9a4SMatthew Dillon.Sh HISTORY
1267a2de9a4SMatthew DillonThe
1277a2de9a4SMatthew Dillon.Nm
1287a2de9a4SMatthew Dillondriver first appeared in
1297a2de9a4SMatthew Dillon.Dx 2.5.1 .
1307a2de9a4SMatthew Dillon.Sh AUTHORS
1317a2de9a4SMatthew Dillon.An -nosplit
1327a2de9a4SMatthew DillonThe
1337a2de9a4SMatthew Dillon.Nm
1347a2de9a4SMatthew Dillonkernel implementation was written by
1357a2de9a4SMatthew Dillon.An Julio M. Merino Vidal Aq jmmv@NetBSD.org
1367a2de9a4SMatthew Dillonas a Google SoC project.
1377a2de9a4SMatthew Dillon.Pp
1387a2de9a4SMatthew Dillon.An Rohit Jalan
1397a2de9a4SMatthew Dillonand others ported it from
1407a2de9a4SMatthew Dillon.Nx
1417a2de9a4SMatthew Dillonto
1427a2de9a4SMatthew Dillon.Fx .
1437a2de9a4SMatthew Dillon.Pp
1447a2de9a4SMatthew Dillon.An Naoya Sugioka
1457a2de9a4SMatthew Dillonand others ported it from
1467a2de9a4SMatthew Dillon.Nx
1477a2de9a4SMatthew Dillonto
1487a2de9a4SMatthew Dillon.Dx .
1497a2de9a4SMatthew Dillon.Pp
1507a2de9a4SMatthew DillonThis manual page was written by
1517a2de9a4SMatthew Dillon.An Xin LI Aq delphij@FreeBSD.org .
1527a2de9a4SMatthew Dillon.Sh BUGS
153d7be93f6SMatthew DillonHopefully not.
154