How to increase tmp/ directory space?

My manjaro partition has lot of space but my tmp/ directory only has 3.8 GB space . Is it possible to increase its space? or should I just not mess around with it?

1 Like

Hi @Char,

As far as I’m aware, you can’t change that size as it depends on you amount of RAM, seeing as it’s a tmpfs, so in the RAM directly.

If you really want to increase it, I’d suggest buying more RAM.

1 Like

/tmp is on tmpfs and approximates half your ram. There is usually no reason to change this - exceptional circumstances may warrant it …

You can change this - simply comment the tmpfs assignment in /etc/fstab - save the file and reboot

tmpfs     /tmp     tmpfs   defaults,noatime,mode=1777 0 0

/var/tmp exist in the normal filesystem and is preferred if files need to persist across reboots.

1 Like

Thank you so much

Commenting out the line — which shouldn’t even be there, because systemd already mounts a tmpfs on top of /tmp even without the entry in /etc/fstab — does not change the maximum size of one’s /tmp. The default is always going to be half of one’s RAM.

tmpfs does however allow one to specify its maximum size via the mount options — see…

man tmpfs

If you want /tmp to have a maximum size of — just as an example — 6 GiB, then you would put something like the following in /etc/fstab. :point_down:

tmpfs     /tmp     tmpfs   defaults,noatime,mode=1777,size=6g   0 0

You can also specify a percentage of your RAM instead. So if e.g. you want to reserve 40% of your RAM, you would do something like this… :point_down:

tmpfs     /tmp     tmpfs   defaults,noatime,mode=1777,size=40%   0 0

Oh yes it’s so helpful

1 Like

why you want change ???
In app sometime we can change “cache” directory. For example, we have flags with yay or pamac build for compile big package.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.