September 2016
Intermediate to advanced
989 pages
24h 10m
English
There are always some files that have a short lifetime or which have no significance after a reboot. Many such files are put into /tmp, and so it makes sense to keep these files from reaching permanent storage.
The temporary filesystem, tmpfs, is ideal for this purpose. You can create a temporary RAM-based filesystem by simply mounting tmpfs:
# mount -t tmpfs tmp_files /tmp
As with procfs and sysfs, there is no device node associated with tmpfs so you have to supply a place-keeper string, tmp_files in the preceding example.
The amount of memory used will grow and shrink as files are created and deleted. The default maximum size is half the physical RAM. In most cases, it would be a disaster if tmpfs grew that large, so it is ...
Read now
Unlock full access