Up to Leap 42.3 you have the possibility to have “/tmp” using “tmpfs”.
In the partitioner you have the option to add partition using tmpfs : http://paste.opensuse.org/87010584
per the SDB:SSD Performance Doc, I didn’t have to remove the /tmp directory. The doc says:
It is highly recommended to put the most volatile parts of your data on a TMPFS - this especially includes the /tmp directory. This directory only contains temporary files which are deleted upon reboot. Having this in memory is an excellent way to save your SSD some work. Note that if you keep your system running for a long time, the size of this directory (hence its memory usage) can balloon quite a bit. It is recommended to log out of your DE, remove the content, and log in again if you're experiencing memory pressure.
Mount /tmp in a tmpfs filesystem:
# ln -s /usr/share/systemd/tmp.mount /etc/systemd/system/
This will create the /tmp folder in memory on a fresh boot.
Nothing about having to remove the /tmp directory. (Perhaps the behavior has been changed? I see removing /tmp is mentioned in the bug report. )
What I try to ask is ( and my post is a question ) :
During install , the install process create a folder ‘/tmp’
If the install process create a folder ‘/tmp’ in /If after first reboot you want to create a folder ‘/tmp’ using tmpfs
[INDENT=2]If you succeeded then [/INDENT]
[INDENT=3]you got two ‘/tmp’ folders ( But I guess it is not possible )
[/INDENT]
[INDENT=2]else[/INDENT]
[INDENT=3]you first destroy the folder ‘/tmp’ in /
you secondly create ‘/tmp’ using tmpfs
[/INDENT]
[INDENT=2]fi[/INDENT]
else
[INDENT=2]If during install , the install process has created silently the folder ‘/tmp’ using something like tmpfs by the mean of systemd
[/INDENT]
[INDENT=3]it should be appreciated to be informed that there is nothing to do.
[/INDENT]
[INDENT=2]else[/INDENT]
[INDENT=3]if the way that systemd use to manage the ‘/tmp’ folder authorize a simple command like [/INDENT]
[INDENT=4]
[/INDENT]
[INDENT=3]it should be appreciated to be informed that there is nothing more to do.
I’ll just say that I have recently followed your suggestion on creating that symbolic link. And it has worked to give me a “tmpfs” file system for “/tmp”.
[INDENT=2]
[/INDENT]
I think you are not fully understanding how mounting works.
A file system is always mounted on top of a directory. So the original “/tmp” becomes the mount point, and the “tmpfs” file system is mounted on top of that.
When you mount a file system on top of a directory, the root directory of that mounted file system becomes, in effect, the same directory name as the mount point.
If “/tmp” does not already exist, the “systemd” creates it when it first tries to mount the “tmpfs” file system there.
So I have created the suggested symbolic link. And then I reboot. And, after reboot, I check the output of “df” and see that I do now have a “tmpfs” file system mounted as “/tmp”.
I can then do:
mount --bind / /mnt
cd /mnt/tmp
I should then be looking at the old “/tmp” before the “tmpfs” file system was mounted on it. And I can compare the file times in the current directory with those of the mounted “/tmp”
ls -l
ls -l /tmp
That’s a good cross check that they are different directories. And since I should not need any of those older files, I remove them:
rm -rf *
rm -rf .??*
And finally, I undo the “bind” mount with
cd /
umount /mnt
and the directory (mount point directory) should now remain empty, because everything new goes to the tmpfs mounted “/tmp”.