LLI Wiki — My Digital Knowledge Base

Linux : agrandir /tmp (tmpfs) à chaud ou durablement

Agrandir /tmp monté en tmpfs avec mount -o remount, puis rendre le changement permanent via fstab ou systemd.

Quand /tmp est monté en tmpfs, sa taille est limitée (par défaut la moitié de la RAM). Voici comment l'agrandir temporairement ou durablement.

Agrandir à chaud (non persistant)

mount -o remount,size=5G /tmp/

Le changement est immédiat, sans démontage, mais il est perdu au prochain redémarrage.

Rendre le changement permanent

Avec /etc/fstab :

vi /etc/fstab
tmpfs   /tmp   tmpfs   defaults,size=5G   0   0

Avec systemd, si /tmp est géré par l'unité tmp.mount :

systemctl edit tmp.mount
[Mount]
Options=mode=1777,strictatime,nosuid,nodev,size=5G

Remarques

Mastodon LLIMastodon SocialFosstodon