User Tools

Site Tools


bash:directories:place_tmp_on_a_tmpfs_partition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

bash:directories:place_tmp_on_a_tmpfs_partition [2022/06/13 09:21] – created peterbash:directories:place_tmp_on_a_tmpfs_partition [2022/06/13 09:21] (current) peter
Line 1: Line 1:
 ====== BASH - Directories - Place /tmp on a tmpfs partition ====== ====== BASH - Directories - Place /tmp on a tmpfs partition ======
 +
 +<WRAP important>
 +**WARNING:**  Only follow these instructions if your system had at least 4GB memory!
 +
 +Because then this tweak won't make them faster, but (much) slower.
 +</WRAP>
 +
 +Speed up your system a bit by placing **/tmp** on a tmpfs partition.
 +
 +Any temporary files will not be placed on the hard disk anymore, but on a virtual RAM disk instead.
 +
 +----
 +
 +
 +<code bash>
 +sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/
 +sudo systemctl enable tmp.mount
 +</code>
 +
 +Reboot your computer.
 +
 +After the reboot, check whether it works:
 +
 +<code bash>
 +systemctl status tmp.mount
 +</code>
 +
 +By  default, a tmpfs partition has its maximum size set to half your total RAM.
 +
 +The actual memory consumption depends on how much you fill it up, as a tmpfs partition doesn't consume any memory until it is actually needed.
 +
 +----
 +
 +===== To undo tmpfs =====
 +
 +<code bash>
 +sudo rm -v /etc/systemd/system/tmp.mount
 +</code>
 +
 +Reboot.
  
bash/directories/place_tmp_on_a_tmpfs_partition.1655112087.txt.gz · Last modified: 2022/06/13 09:21 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki