Mount partition as /tmp instead of tmpfs

I upgraded from OpenSUSE 13.2 to Leap 42.2 a few weeks back. I did not notice at the time that /tmp switched from my physical volume to tmpfs. A google search turns up much debate on this change. What I don’t see is any instruction on how to go back to using my original drive partition for /tmp. I was able to find how to disable tmp on tmpfs documented on the fedora site (but not at OpenSUSE) using “systemctl mask tmp.mount”. However, this fails to auto-mount the /tmp entry in /etc/fstab. I can manually mount /tmp using “sudo mount /tmp” so it seems unlikely that the problem is the fstab entry.

 /dev/mapper/cr_tmp   /tmp                 ext4       acl,user_xattr,nofail 0 2 

Thanks in advance!

Most probably you did not have a separate partition for /tmp. When you want that restored, simply remove the entry from /etc/fstab and reboot.

But why do you insist on not having it as tmpfs? Did you encounter any problem?

I have /tmp on tmpfs since years. Never saw any problem. And the nice thing is I do not have to configure anything to clear it on boot, or to watch it for growing. :slight_smile:

Oh, and rereading your post, it seems you had /tmp on a separate partition earlier for reasons unknown to us. Then you should restore the entry you used earlier in the same place in /etc/fstab as earlier. This in the assumption that the volume you used for it earlier is still there and not used for anything else.

I won’t get into why I prefer /tmp as a physical volume versus ram.

Note that my /etc/fstab entry for /tmp never went away. It’s the same as it has been for years. The fstab entry (which I posted in the original message) has been ignored since the upgrade.

“mount /tmp” works fine manually. It won’t automount on boot.

Ok, I see.

Can you please post something for us to look at. E.g. how you came to the conclusion that it is now tmpfs, probably by using

mount

And you could of course check if there are problems mounting it during boot by looking at the boot screen (Esc key) and/or dmesg.

I came to that conclusion by dealing with a sluggish system, then seeing that half of my available memory (according to top) was being used by something other than process threads. After I went looking, I saw that df showed /tmp was now mounted as a tmpfs filesystem, and that it was almost full. Masking tmp.mount stopped the issue with tmpfs being used but failed to mount /tmp from my partition. A couple more reboots didn’t cause it to mount. When I went back to unmask and enable tmp.mount to give you actual output showing /tmp mounted on tmpfs, “systemctl enable” failed with "Failed to execute operation: No such file or directory ", but this series of commands did fix the problem with the partition mount of /tmp. So while I can’t say where things went wrong and exactly why they went right again, apparently it worked well enough to fix my problem. I also see that the real /tmp partition was mounted as recently as Jul 29th, so apparently /tmp was only mounted on tmpfs for the last couple of days. Maybe some error on startup (bad encryption password?) caused it to fall back to tmpfs when the /tmp partition wasn’t available. My attempt to fix the problem apparently made the situation worse since it was only temporarily using tmpfs. Thanks again for your help!

Well, a bit unsatisfying that the exact flow of things is not understood, but at least it seems now working as you want it.

You are welcome and enjoy openSUSE.

Simplest solution is to open your Disk Partitioner (using YaST)
Find the partition or mount point you want to change.
Double-click it to open the properties.
Select Edit.
Change how it’s mounted.
Save.

TSU