1.\" 2.\" Copyright (c) 2007 Xin LI 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. The name of the author may not be used to endorse or promote products 14.\" derived from this software without specific prior written permission 15.\" 16.\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.\" $FreeBSD: src/share/man/man5/tmpfs.5,v 1.7 2010/01/29 15:11:50 jh Exp $ 28.\" 29.Dd February 2, 2010 30.Dt TMPFS 5 31.Os 32.Sh NAME 33.Nm tmpfs 34.Nd "efficient memory file system" 35.Sh SYNOPSIS 36To compile this driver into the kernel, 37place the following line in your 38kernel configuration file: 39.Bd -ragged -offset indent 40.Cd "options TMPFS" 41.Ed 42.Pp 43Alternatively, to load the driver as a 44module at boot time, place the following line in 45.Xr loader.conf 5 : 46.Bd -literal -offset indent 47tmpfs_load="YES" 48.Ed 49.Sh OPTIONS 50The following options are available when 51mounting 52.Nm 53file systems: 54.Bl -tag -width indent 55.It Cm gid 56root group id. 57.It Cm uid 58root user id. 59.It Cm mode 60permissions in octal format. 61.It Cm inodes 62maximum number of inodes. 63.It Cm size 64maximum size for the file system. 65.It Cm maxfilesize 66maximum file size of the file system. 67.El 68.Sh DESCRIPTION 69In the 70.Dx 71implementation, 72.Nm 73filesystems are backed by swap space. 74Only memory pressure will cause data to be backed to swap. 75Normal filesystem operations such as 76.Fn fsync , 77buffer cache flushing, and vnode recycling have no effect. 78.Pp 79.Nm 80stores meta-data in wired kernel memory. 81Meta-data is not backed by swap so care must be taken if using 82.Nm 83to store large numbers of small files. 84.Pp 85It is recommended that a large amount of swap space be reserved on modern 86.Dx 87platforms to accommodate 88.Nm 89and other subsystems. 9032-bit kernels can accommodate 32G of swap by default while 64-bit kernels 91can accommodate 512G of swap by default. 92These defaults can be increased though it should be noted that 32-bit 93kernels are ultimately limited by the amount of KVM available in its 94small 32-bit address space. 95.Pp 96.Nm 97will allocate and deallocate swap backing store on the fly based on usage. 98By default 99.Nm 100allows up to 100% of swap space to be used. 101If this is not desirable then the size option should be used to limit 102its size. 103.Pp 104Every option that accepts a numerical value as its argument can take a 105trailing 106.Sq b 107to indicate bytes (the default), a trailing 108.Sq k 109to indicate kilobytes, a trailing 110.Sq M 111to indicate megabytes or a trailing 112.Sq G 113to indicate gigabytes. 114Note that both lowercase and uppercase forms of these letters are allowed. 115.Sh EXAMPLES 116To mount a 117.Nm 118memory file system: 119.Pp 120.Dl "mount -t tmpfs tmpfs /tmp" 121.Sh SEE ALSO 122.Xr fstab 5 , 123.Xr mount_nfs 8 , 124.Xr mount_tmpfs 8 , 125.Xr swapcache 8 126.Sh HISTORY 127The 128.Nm 129driver first appeared in 130.Dx 2.5 . 131.Sh AUTHORS 132.An -nosplit 133The 134.Nm 135kernel implementation was written by 136.An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org 137as a Google SoC project. 138.Pp 139.An Rohit Jalan 140and others ported it from 141.Nx 142to 143.Fx . 144.Pp 145.An Naoya Sugioka 146and others ported it from 147.Nx 148to 149.Dx . 150.Pp 151This manual page was written by 152.An Xin LI Aq Mt delphij@FreeBSD.org . 153.Sh BUGS 154To mount NFS exported 155.Nm 156.Dx 157NFS client need to disable ReaddirPlus, see 158.Xr mount_nfs 8 . 159