I'm using 2G of tmpfs for /tmp dir to increase performance for java unit-testing: they are performing IO operations intensively in /tmp.
Here is my tmp section from /etc/fstab file:
tmpfs /tmp tmpfs rw,noatime,size=2G,nodev,mode=1777,noexec,nosuid,rootcontext=system_u:object_r:tmp_t 0 0
Almost always it's working fine, but sometimes I need more than 2G disk space in /tmp. It usually happens when some application downloading updates. In this case performance is not critical for me, so I'd like to write it to physical volume or loopback file.
Is it possible to use tmpfs if /tmp dir size is less than 2G and extend it with other file system when required?
/tmp, symlink it to somewhere else? – Kusalananda Sep 23 '17 at 11:19java.io.tmpdir...) That way you could have/tmpas a regular filesystem, big enough for the applications downloading updates, and a tmpfs just for your unit tests. – Stephen Kitt Sep 23 '17 at 11:58