17

Oct 08

All about tmpfs

tmpfs is supported by the Linux kernel from version 2.4 and up. 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”.

No comments yet, be the first.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.