Page 2 of 4
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 8:45 am
by fehlix
BitJam wrote: Sun Dec 23, 2018 1:49 am
It is okay for /tmp to be tmpfs because there is no guarantee that files under /tmp will survive a reboot.
The question remains, how can we follow the Linux Filesystem Hierarchy Standard, which states clearly:
Chapter: 3.18. /tmp : Temporary files wrote:Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.
As within the installed system we do have currently /tmp symlinked => /var/tmp and by this we do not follow the standard,
as we must not delete /var/tmp on reboot, and hence cannot clear /tmp on reboot.
Suggest to change our current default to have /tmp not symlinked to /var/tmp but keep it as separate /tmp folder.
And we make sure that the default deletion of files in /tmp are activated ( e.g. in /etc/default/rcS ).
If users than want to have /tmp put as tmpfs into shared memory we might add a commented line into /etc/fstab
something like:
Code: Select all
#uncomment to have /tmp as temporary filesystem that resides in memory
#tmpfs /tmp tmpfs defaults,mode=1777 0 0
which might help the user to easily put /tmp in RAM by just commenting out this /tmp line in /etc/fstab

Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:04 am
by oops
@fehlix ...The question is especially: is this standard relevant?
For which features /var/tmp is very important to keep?
Otherwise there is no relevance to changing current behavior (IMHO).
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:11 am
by fehlix
oops wrote: Sun Dec 23, 2018 9:04 am
@fehlix ...The question is especially: is this standard relevant?
For which features /var/tmp is very important to keep?
Otherwise there is no relevance to changing current behavior (IMHO).
Yes, the point is, as soon as you install a app/programm, which is programmed
according to the standard and requires to have it's var/tmp data available after reboot
to function properly, you might have an issue, as the app might not work properly.
So as @BitJam pointed out better stay with the standard to avoid issues later.

Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:18 am
by oops
@fehlix
Yes but in an exhaustive way, for which programs (they must be probably very rare?)
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:24 am
by fehlix
oops wrote: Sun Dec 23, 2018 9:18 am
@fehlix
Yes but exhaustively, for which programs (they must be very very rare?)
Good question .. you might find out (or not) when something is not behaving properly, and you start to debug

Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:35 am
by anticapitalista
Running live does not symlink tmp to /var/tmp.
Only on installation does it do so.
The gui installer has these lines.
Code: Select all
if (exitStatus == QProcess::NormalExit) {
updateStatus(tr("Fixing configuration"), 99);
chmod("/mnt/antiX/var/tmp",01777);
shell.run("cd /mnt/antiX && ln -s var/tmp tmp");
This must have been a decision by MEPIS.
antiX cli-installer also does not symlink tmp to var/tmp
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 9:47 am
by fehlix
anticapitalista wrote: Sun Dec 23, 2018 9:35 am
Running live does not symlink tmp to /var/tmp.
Only on installation does it do so.
The gui installer has these lines.
Code: Select all
if (exitStatus == QProcess::NormalExit) {
updateStatus(tr("Fixing configuration"), 99);
chmod("/mnt/antiX/var/tmp",01777);
shell.run("cd /mnt/antiX && ln -s var/tmp tmp");
This must have been a decision by MEPIS.
antiX cli-installer also does not symlink tmp to var/tmp
May I interpret your comment, as support of my proposal to keep /tmp not symlinked to /var/tmp in MX Linux, which I hope is the case

Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 10:12 am
by anticapitalista
fehlix wrote: Sun Dec 23, 2018 9:47 am
anticapitalista wrote: Sun Dec 23, 2018 9:35 am
Running live does not symlink tmp to /var/tmp.
Only on installation does it do so.
The gui installer has these lines.
Code: Select all
if (exitStatus == QProcess::NormalExit) {
updateStatus(tr("Fixing configuration"), 99);
chmod("/mnt/antiX/var/tmp",01777);
shell.run("cd /mnt/antiX && ln -s var/tmp tmp");
This must have been a decision by MEPIS.
antiX cli-installer also does not symlink tmp to var/tmp
May I interpret your comment, as support of my proposal to keep /tmp not symlinked to /var/tmp in MX Linux, which I hope is the case
From MX-19 onwards, ok if the other devs have no objections.
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 10:15 am
by MAYBL8
Ok I have read all of your posts.
So I am confused.
Do I need tmpfs to be /var/tmp for my SSD to be set up correctly or does it not matter how this is set?
Sorry if I am taking this thread off topic.
Re: Mount /tmp as tmpfs
Posted: Sun Dec 23, 2018 10:25 am
by fehlix
dcihon wrote: Sun Dec 23, 2018 10:15 am
So I am confused.
Sorry about this
Here what I would do:
Reboot with LiveUSB MX18
Mount rootMX17 or rootMX18
Assuming now rootMX18 is mounted under /media/demo/rootMX18:
Edit as root fstab /media/demo/rootMX18/etc/fstab
within the mounted rootMX18 and add this line to fstab
Code: Select all
tmpfs /tmp tmpfs defaults,mode=1777 0 0
NOTE: noatime option as we are dealing with SSD noatime not needed in tmpfs
Now remove the tmp->var/tmp symlink
i.e. remove /media/demo/rootMX18/tmp < this is a symlink to var/tmp
Create an empty folder ( as user root )
/media/demo/rootMX18/tmp
now reboot.

EDIT: noatime is not need in tmpfs -