Page 1 of 4

Mount /tmp as tmpfs

Posted: Mon Dec 18, 2017 8:18 am
by dr-kart
:confused: couldn't find anything fresh on this over recent forum posts.
...looking at https://wiki.debian.org/SSDOptimization ... ia_RAMDISK

So does it make sense (if any) to add to fstab

Code: Select all

tmpfs /tmp tmpfs noatime,nosuid 0 0
and (or) do we get some unwanted side effects here? Since mx wiki/help keeps silence on this.
In general this is the question to find reasonable optimal way to boost RAM usage via fstab or /etc/default/tmpfs or else.
arch-ers have it by default afaik

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 12:52 am
by freefreeno
I also would like to know what MX says about this because like you I can find it all over the web but I haven't seen anything on MX forums about it. I do mine this way in arch but I am not for sure on here.
tmpfs /tmp tmpfs noexec,noatime 0 0
tmpfs /home/josh/.cache/google-chrome/Default tmpfs noexec,noatime 0 0

I have been doing it this way but if I am wrong or there is a better way let me know.

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 7:28 am
by dphn
You don't need it on MX. /tmp linked to /var/tmp and this loads to RAM. Good configuration on MX.

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 10:03 am
by oops
dphn wrote: Sat Dec 22, 2018 7:28 am You don't need it on MX. /tmp linked to /var/tmp and this loads to RAM. Good configuration on MX.
Yes , and to check:

Code: Select all

cat /proc/mounts | grep /tmp
#or
cat /proc/mounts | grep tmpfs

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 5:53 pm
by MAYBL8
Mine shows this but I don't know what any of it means:
Is my SSD ok with this?

Code: Select all

dcihon@mx:~/.conky$ cat /proc/mounts | grep tmpfs
udev /dev devtmpfs rw,nosuid,relatime,size=8158164k,nr_inodes=2039541,mode=755 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=1636936k,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=6629300k 0 0
cgroup /sys/fs/cgroup tmpfs rw,relatime,size=12k,mode=755 0 0
tmpfs /run/user/115 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=115,gid=126 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=1000,gid=1000 0 0

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 6:17 pm
by fehlix
dcihon wrote: Sat Dec 22, 2018 5:53 pm Mine shows this but I don't know what any of it means:
Is my SSD ok with this?
This means that neither /tmp nor ( symlinked to) /var/tmp is mounted into shared memory RAM (aka tmpfs)
but instead resides on the disk. If /tmp ( symlinked to /var/tmp) is desired to have as shared memory tmpfs
( and probably for SSD recommended if enough RAM is available)
this line within /etc/fstab is required:

Code: Select all

tmpfs      /tmp           tmpfs   defaults,mode=1777 0  0
:puppy:
EDIT: Corrected to have /tmp as tmpfs, as clarfied by BitJam here

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 6:24 pm
by MAYBL8
Ok now it shows this:

Code: Select all

dcihon@mx:~/.conky$ cat /proc/mounts | grep tmpfs
udev /dev devtmpfs rw,nosuid,relatime,size=8158164k,nr_inodes=2039541,mode=755 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=1636936k,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=6629300k 0 0
tmpfs /var/tmp tmpfs rw,relatime 0 0
cgroup /sys/fs/cgroup tmpfs rw,relatime,size=12k,mode=755 0 0
tmpfs /run/user/115 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=115,gid=126 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=1000,gid=1000 0 0

Re: Mount /tmp as tmpfs

Posted: Sat Dec 22, 2018 6:41 pm
by fehlix
dcihon wrote: Sat Dec 22, 2018 6:24 pm Ok now it shows this:

Code: Select all

dcihon@mx:~/.conky$ cat /proc/mounts | grep tmpfs
udev /dev devtmpfs rw,nosuid,relatime,size=8158164k,nr_inodes=2039541,mode=755 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=1636936k,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=6629300k 0 0
tmpfs /var/tmp tmpfs rw,relatime 0 0
cgroup /sys/fs/cgroup tmpfs rw,relatime,size=12k,mode=755 0 0
tmpfs /run/user/115 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=115,gid=126 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1636932k,mode=700,uid=1000,gid=1000 0 0
nice , when you open /tmp in Thunar you see free space is related to your available ram.
I think default for tmpfs to have 50% RAM promised for tmpfs to be used, sure lot's of tweaking can be done here.
Only if enough RAM is available this is recommended - otherwise tmpfs would go swapped out into disk on swap-partition/file :eek:

Re: Mount /tmp as tmpfs

Posted: Sun Dec 23, 2018 1:49 am
by BitJam
dphn wrote: Sat Dec 22, 2018 7:28 am You don't need it on MX. /tmp linked to /var/tmp and this loads to RAM. Good configuration on MX.
This configuration does not follow the Linux Filesystem Hierarchy Standard. It is okay for /tmp to be tmpfs because there is no guarantee that files under /tmp will survive a reboot. But the whole point of having a separate /var/tmp is so that files put there can survive a reboot.

From the Filesystem Hierarchy Standard:
/var/tmp : Temporary files preserved between system reboots

The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.

Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.

Re: Mount /tmp as tmpfs

Posted: Sun Dec 23, 2018 7:59 am
by fehlix
BitJam wrote: Sun Dec 23, 2018 1:49 am The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.
Thanks, for pointing that out.