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 647a2de9a4SMatthew Dillonmaximum size (in bytes) for the file system. 657a2de9a4SMatthew Dillon.It Cm maxfilesize 667a2de9a4SMatthew Dillonmaximum file size (in bytes). 677a2de9a4SMatthew Dillon.El 68*d7be93f6SMatthew Dillon.Sh DESCRIPTION 69*d7be93f6SMatthew DillonIn the 70*d7be93f6SMatthew Dillon.Dx 71*d7be93f6SMatthew Dillonimplementation, 72*d7be93f6SMatthew Dillon.Nm 73*d7be93f6SMatthew Dillonfilesystems are backed by swap space. 74*d7be93f6SMatthew DillonOnly memory pressure will cause data to be backed to swap. 75*d7be93f6SMatthew DillonNormal filesystem operations such as fsync(), buffer cache flushing, 76*d7be93f6SMatthew Dillonand vnode recycling have no effect. 77*d7be93f6SMatthew Dillon.Pp 78*d7be93f6SMatthew Dillon.Nm 79*d7be93f6SMatthew Dillonstores meta-data in wired kernel memory. Meta-data is not backed by 80*d7be93f6SMatthew Dillonswap so care must be taken if using 81*d7be93f6SMatthew Dillon.Nm 82*d7be93f6SMatthew Dillonto store large numbers of small files. 83*d7be93f6SMatthew Dillon.Pp 84*d7be93f6SMatthew DillonIt is recommended that a large amount of swap space be reserved on modern 85*d7be93f6SMatthew Dillon.Dx 86*d7be93f6SMatthew Dillonplatforms to accomodate 87*d7be93f6SMatthew Dillon.Nm 88*d7be93f6SMatthew Dillonand other subsystems. 89*d7be93f6SMatthew Dillon32-bit kernels can accomodate 32G of swap by default while 64-bit kernels 90*d7be93f6SMatthew Dilloncan accomodate 512G of swap by default. 91*d7be93f6SMatthew DillonThese defaults can be increased though it should be noted that 32-bit 92*d7be93f6SMatthew Dillonkernels are ultimately limited by the amount of KVM available in its 93*d7be93f6SMatthew Dillonsmall 32-bit address space. 94*d7be93f6SMatthew Dillon.Pp 95*d7be93f6SMatthew Dillon.Nm 96*d7be93f6SMatthew Dillonwill allocate and deallocate swap backing store on the fly based on usage. 97*d7be93f6SMatthew DillonBy default 98*d7be93f6SMatthew Dillon.Nm 99*d7be93f6SMatthew Dillonallows up to 100% of swap space to be used. 100*d7be93f6SMatthew DillonIf this is not desireable then the size option should be used to limit 101*d7be93f6SMatthew Dillonits size. 1027a2de9a4SMatthew Dillon.Sh EXAMPLES 1037a2de9a4SMatthew DillonTo mount a 1047a2de9a4SMatthew Dillon.Nm 1057a2de9a4SMatthew Dillonmemory file system: 1067a2de9a4SMatthew Dillon.Pp 1077a2de9a4SMatthew Dillon.Dl "mount -t tmpfs tmpfs /tmp" 1087a2de9a4SMatthew Dillon.Sh SEE ALSO 1097a2de9a4SMatthew Dillon.Xr nmount 2 , 1107a2de9a4SMatthew Dillon.Xr unmount 2 , 1117a2de9a4SMatthew Dillon.Xr fstab 5 , 112*d7be93f6SMatthew Dillon.Xr mount 8 , 113*d7be93f6SMatthew Dillon.Xr swapcache 8 1147a2de9a4SMatthew Dillon.Sh HISTORY 1157a2de9a4SMatthew DillonThe 1167a2de9a4SMatthew Dillon.Nm 1177a2de9a4SMatthew Dillondriver first appeared in 1187a2de9a4SMatthew Dillon.Dx 2.5.1 . 1197a2de9a4SMatthew Dillon.Sh AUTHORS 1207a2de9a4SMatthew Dillon.An -nosplit 1217a2de9a4SMatthew DillonThe 1227a2de9a4SMatthew Dillon.Nm 1237a2de9a4SMatthew Dillonkernel implementation was written by 1247a2de9a4SMatthew Dillon.An Julio M. Merino Vidal Aq jmmv@NetBSD.org 1257a2de9a4SMatthew Dillonas a Google SoC project. 1267a2de9a4SMatthew Dillon.Pp 1277a2de9a4SMatthew Dillon.An Rohit Jalan 1287a2de9a4SMatthew Dillonand others ported it from 1297a2de9a4SMatthew Dillon.Nx 1307a2de9a4SMatthew Dillonto 1317a2de9a4SMatthew Dillon.Fx . 1327a2de9a4SMatthew Dillon.Pp 1337a2de9a4SMatthew Dillon.An Naoya Sugioka 1347a2de9a4SMatthew Dillonand others ported it from 1357a2de9a4SMatthew Dillon.Nx 1367a2de9a4SMatthew Dillonto 1377a2de9a4SMatthew Dillon.Dx . 1387a2de9a4SMatthew Dillon.Pp 1397a2de9a4SMatthew DillonThis manual page was written by 1407a2de9a4SMatthew Dillon.An Xin LI Aq delphij@FreeBSD.org . 1417a2de9a4SMatthew Dillon.Sh BUGS 142*d7be93f6SMatthew DillonHopefully not. 143