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.
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.
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.
Before you can use tmpfs, you have to rebuild your Kernel. To enable TMPFS please ensure that the line
is available and uncommented in your Kernel config file. Now, rebuild your Kernel and reboot.
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:
# mount_tmpfs tmpfs /tmp
and check, if it is mounted:
# mount tmpfs on /tmp type tmpfs (local)
You can now edit your
/etc/fstab to mount it automatically everytime you boot. Please add exactly this line to your
tmpfs /tmp tmpfs rw
You're done. Have fun.
Unfortunately tmpfs doesn't support whiteouts yet. That's why it can't be used with union_mount's.