Annotation of wikisrc/tutorials/how_to_use_tmpfs.mdwn, revision 1.1
1.1 ! mspo 1: **Contents**
! 3: [[!toc]]
! 5: # What is tmpfs ?
! 7: tmpfs is an efficient memory file system written by Julio M. Merino Vidal during the Summer of Code Project in 2005. It was merged into the NetBSD tree on the 10th of September 2005. Tmpfs left experimental status on 11/11/2006 and is now enabled by default in all GENERIC kernels.
! 9: # How does it work ?
! 11: In the contrary to mfs, tmpfs uses its own data structures to manage the stored files. It uses the correct amount of memory to work correctly and efficiently, which means it grows and shrinks.
! 13: # Why do I need it ?
! 15: Normally you don't. You can work with your hard disk. But you can use it to reduce hard disk activity, if you store temporary data to tmpfs, which is faster aswell. I personally prefer tmpfs for `/tmp` and use it on all my servers.
! 17: # How do I use it ?
! 19: Before you can use tmpfs, you have to rebuild your Kernel. To enable TMPFS please ensure that the line
! 21: file-system TMPFS
! 24: is available and uncommented in your Kernel config file. Now, rebuild your Kernel and reboot.
! 26: # Testing tmpfs
! 28: Before we change the file `/etc/fstab`, we have to ensure, that tmpfs is working. Otherwise your server won't be able to boot. To test if tmpfs is working, mount it manually with:
! 30: # mount_tmpfs tmpfs /tmp
! 33: and check, if it is mounted:
! 35: # mount
! 36: tmpfs on /tmp type tmpfs (local)
! 39: # Editing fstab
! 41: You can now edit your `/etc/fstab` to mount it automatically everytime you boot. Please add exactly this line to your `/etc/fstab`:
! 43: tmpfs /tmp tmpfs rw
! 46: You're done. Have fun.
! 48: # Caveats
! 50: Unfortunately tmpfs doesn't support whiteouts yet. That's why it can't be used with union_mount's.
! 52: # See also
! 54: * [mount_tmpfs(8)](http://netbsd.gw.com/cgi-bin/man-cgi?mount_tmpfs+8+NetBSD-current)
! 57: # View source code (Please report any bugs or suggestions [here](http://www.netbsd.org/cgi-bin/sendpr.cgi?gndb=netbsd)).
! 60: * [mount_tmpfs.c](http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/sbin/mount_tmpfs/mount_tmpfs.c?rev=HEAD)
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb