June 2017
Intermediate to advanced
478 pages
13h 14m
English
There are always some files that have a short lifetime or 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 to be that large, ...
Read now
Unlock full access