Sunday, 8 November 2020

put /tmp on tmpfs

 

Lots of RAM (at least 8 GB): put /tmp on tmpfs

9. Does your system have lots of RAM memory? If it has at least 8 GB, then you can probably speed up your system a bit by placing /tmp on a tmpfs partition. Which means, translated into ordinary language: you bring about that temporary files will not be placed on the hard disk anymore, but on a virtual RAM disk instead.

This is how you do it:

a. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Copy/paste this blue line into the terminal (it's one line!):

sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/

Press Enter. Type your password when prompted; your password will remain entirely invisible, not even dots will show when you type it, this is normal.

b. Then copy/paste this command into the terminal:

sudo systemctl enable tmp.mount

Press Enter.

c. Reboot your computer.

d. After the reboot: check whether it works, with this terminal command:

systemctl status tmp.mount

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.

Note: do not apply this on systems with less RAM than 8 GB! Because then this tweak might not make them faster, but (much) slower.

How to undo tmpfs

9.1. Do you wish to undo tmpfs? Then copy/paste this line into the terminal:

sudo rm -v /etc/systemd/system/tmp.mount

Press Enter. Type your password when prompted; your password will remain entirely invisible, not even dots will show when you type it, this is normal.

Afterwards, reboot your computer.
Share:

0 comments:

Post a Comment