TMPFS

TMPFS

tmpfs is a common name for a temporary file storage facility on many
Unix-like operating systems. It is intended to appear as a mounted file system, but one which uses virtual memory instead of a persistent storage device.

Semantics

Everything stored in tmpfs is temporary in the sense that no files will be created on the hard drive; however, swap space is used as backing store in case of low memory situations. On reboot, everything in tmpfs will be lost.

The memory used by tmpfs grows and shrinks to accommodate the files it contains and can be swapped out to swap space.

Many Unix distributions enable and use tmpfs by default for the /tmp branch of the file system or for shared memory. This can be observed with df as in this example:

Filesystem Size Used Avail Use% Mounted on tmpfs 256M 688K 256M 1% /tmp

Implementations

SunOS / Solaris

SunOS, and later Solaris, include some of the earliest implementations of tmpfs; [cite web
url = http://www.solarisinternals.com/si/reading/tmpfs.pdf
title = tmpfs: A Virtual Memory File System
accessdate = 2007-05-07
author = Peter Snyder
format = PDF
] it first appeared in SunOS 4.1, released in March 1990. [cite web
url = http://www.sun3arc.org/papers/Perf/SunOS_4.1_performance_tuning.ps.gz
title = SunOS 4.1 Performance Tuning
accessdate = 2007-05-07
author = Hal L. Stern
format = GZipped PostScript
] As of Solaris 2.1 (November 1994), /tmp is by default a tmpfs file system.

Linux

tmpfs is supported by the Linux kernel from version 2.4 and up. [cite web
url = http://www-128.ibm.com/developerworks/library/l-fs3.html
title = Advanced filesystem implementor's guide
accessdate = 2007-05-07
author = Daniel Robbins
authorlink = Daniel Robbins
date = September 1, 2001
quote =
Article describing the Linux implementation
] tmpfs (previously known as shmfs) distinguishes itself from the Linux ramdisk device by allocating memory dynamically and by allowing less-used pages to be moved onto swap space. RAMFS, in contrast, does not make use of virtual memory (which can be an advantage or disadvantage). In addition, MFS and some older versions of ramfs did not grow and shrink dynamically and instead used a fixed amount of memory at all times.

Usage of tmpfs for example is "mount -t tmpfs -o size=1G,nr_inodes=10k,mode=0700 tmpfs /space" which will allow up to 1 GiB in RAM/swap with 10240 inodes and only accessible by the owner of the directory /space. The filesystem's maximum size can also be changed on-the-fly, like "mount -o remount,size=2G /space".

BSD

tmpfs was merged into the official NetBSD source tree on September 10, 2005. [cite web
url = http://netbsd-soc.sourceforge.net/projects/tmpfs/
title = NetBSD-SoC: Efficient memory file-system
accessdate = 2007-05-07
author = Julio M. Merino Vidal
date = February 24, 2006
]
FreeBSD has ported NetBSD's implementation and is available in 7.0 and later versions.

Microsoft Windows

Windows systems have a rough analog to tmpfs in the form of "temporary files". Files created with both FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE are held in memory and only written to disk if the system experiences low memory pressure. In this way they behave like tmpfs, except the files are written to the specified path during low memory situations rather than swap space. This technique is often used by servers along with TransmitFile to render content to a buffer before sending to the client.

References

* [http://lxr.linux.no/source/Documentation/filesystems/tmpfs.txt Documentation/filesystems/tmpfs.txt] documentation in Linux source tree
* [http://docs.sun.com/app/docs/doc/817-3947/6mjgnrler?l=en&a=view tmpfs(7FS)] Solaris 10 man page
* [http://netbsd.gw.com/cgi-bin/man-cgi?mount_tmpfs+8+NetBSD-current mount_tmpfs(8)] NetBSD man page


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Tmpfs — временное файловое хранилище во многих Unix like ОС. Предназначена для монтирования файловой системы, но размещается в ОЗУ вместо физического диска. Подобная конструкция является RAM диском. Содержание 1 Семантика 2 Реализации 2.1 Sun …   Википедия

  • tmpfs — es el nombre que recibe un sistema de almacenamiento en muchos sistemas operativos de tipo Unix. Aparece como un sistema de archivos montado aunque usa memoria volátil. Es similar a los discos RAM, que aparecen como discos virtuales, y pueden… …   Wikipedia Español

  • tmpfs — (engl. für Temporary File System) ist ein Dateisystem, das in vielen Unix artigen Betriebssystemen als verbesserter Ersatz für eine Ramdisk eingesetzt wird. Im Gegensatz zur Ramdisk bei der realer Arbeitsspeicher verwendet wird, wird bei tmpfs… …   Deutsch Wikipedia

  • TMPFS — Saltar a navegación, búsqueda tmpfs es el nombre que recibe un sistema de almacenamiento en muchos sistemas operativos de tipo Unix. Está preparado para aparecer como un sistema de archivos montado aunque usa memoria virtual. Contenido 1… …   Wikipedia Español

  • TmpFS — (Temporary File System) est le nom générique données à tout système de fichiers Unix temporaire. Tout fichier créé dans un tel système de fichier disparait lors de l arrêt du système. L implémentation par défaut du tmpfs des noyaux Linux 2.6.x[1] …   Wikipédia en Français

  • Tmpfs — (Temporary File System) est le nom générique données à tout système de fichiers Unix temporaire. Tout fichier créé dans un tel système de fichier disparait lors de l arrêt du système. L implémentation par défaut du tmpfs des noyaux Linux 2.6.x[1] …   Wikipédia en Français

  • tmpfs — (Temporary File System) est le nom générique données à tout système de fichiers Unix temporaire. Tout fichier créé dans un tel système de fichiers disparait lors de l arrêt du système. L implémentation par défaut du tmpfs des noyaux Linux… …   Wikipédia en Français

  • TMPFS — ist ein Dateisystem, das in vielen Unix artigen Betriebssystemen als Ramdisk eingesetzt wird. Hierbei wird der Arbeitsspeicher statt der Festplatte als Speicher benutzt. Funktion Alles, was in tmpfs gespeichert wird, ist nur temporär, da es nicht …   Deutsch Wikipedia

  • TMPFS — Temporary File System …   Acronyms

  • TMPFS — Temporary File System …   Acronyms von A bis Z

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”