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?