I am using Fedora 26 and have some troubles with /tmp on tmpfs. By default Fedora sets the /tmp size to a half of RAM size. In my case it is 4/2=2GB. But I noticed this causes faults during some software updates which need to unzip large distribution files.

I have set the /tmp size to 4GB and it solves the problem but I am not sure that was the right strategy, because it is looking stupid to fulfill the unzip task in the single step using all the RAM available and crash when reaching the limit.

  • 1
    Use swap partition/file. – Ipor Sircer Nov 5 '17 at 11:59
  • Swap is on, but unzipping is limited by temp size, not swap – Almaz Nov 5 '17 at 12:06
  • If you "eat your RAM" tmpfs will actually start swapping. So as long as you have overall virtual memory available (RAM + swap - all-overhead-of-all-running-processes) you can increase /tmp, even possibly beyond RAM . Of course everything will be suffering at the end of the unzipping – A.B Nov 5 '17 at 12:09
  • tmpfs can use swap. – Ipor Sircer Nov 5 '17 at 12:09
  • Which software is causing the problem? Can you get it to use /var/tmp instead? – mattdm Nov 9 '17 at 19:03

Issuing # mount -o remount,size=4G,noatime /tmp when you need to do large file operations, adjusting size to fit the task, is one of the correct strategies in your situation, along with being the simplest solution. It will revert to normal on next reboot.

More information, including how to make this permanent, can be found here: https://wiki.archlinux.org/index.php/Tmpfs

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.