I am confused about whether my /tmp using tmpfs is respecting the size
parameter that I gave to it in /etc/fstab
:
My fstab entry is:
tmpfs /tmp tmpfs rw,nodev,noexec,nosuid,relatime,size=4G 0 0
But according to du, it is using half of my memory (which I understand is the default) instead of the size I meant to allocate to it.
~ df /tmpFilesystem 1K-blocks Used Available Use% Mounted ontmpfs 65921428 0 65921428 0% /tmp
So is the size
parameter simply not having any effect?I am working with Ubuntu 20.04
Edit I can mount it manually with
sudo mount -oremount,size=4G /tmp
When I do that /tmp
is the expected 20.04 GB.
Edit: systemd status:
● tmp.mount - Temporary Directory (/tmp) Loaded: loaded (/etc/systemd/system/tmp.mount; enabled; vendor preset: enabled) Active: active (mounted) since Wed 2020-06-17 13:30:35 EDT; 8min ago Where: /tmp What: tmpfs Docs: https://systemd.io/TEMPORARY_DIRECTORIES man:file-hierarchy(7) https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems Tasks: 0 (limit: 154317) Memory: 76.0K CGroup: /system.slice/tmp.mountJun 17 13:30:35 virtland systemd[1]: Mounting Temporary Directory (/tmp)...Jun 17 13:30:35 virtland systemd[1]: Mounted Temporary Directory (/tmp).
and journalctl -u tmp.mount
-- Reboot --Jun 17 13:27:50 virtland systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting an>Jun 17 13:27:50 virtland systemd[1]: Mounting Temporary Directory (/tmp)...Jun 17 13:27:50 virtland systemd[1]: Mounted Temporary Directory (/tmp).Jun 17 13:29:43 virtland systemd[1]: Unmounting Temporary Directory (/tmp)...Jun 17 13:29:43 virtland systemd[1]: tmp.mount: Succeeded.Jun 17 13:29:43 virtland systemd[1]: Unmounted Temporary Directory (/tmp).-- Reboot --Jun 17 13:30:35 virtland systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting an>Jun 17 13:30:35 virtland systemd[1]: Mounting Temporary Directory (/tmp)...Jun 17 13:30:35 virtland systemd[1]: Mounted Temporary Directory (/tmp).``