You are not logged in.

#1 2012-09-04 21:55:24

BenoitSvB
Member
Registered: 2005-08-13
Posts: 9

[SOLVED] HOWTO disable tmpfs on /tmp?

I want to disable tmpfs on /tmp, so I commented-out the relevant line in fstab. Nevertheless something mounted tmpfs on /tmp (systemd?). How to find that something?

Last edited by BenoitSvB (2012-09-06 10:06:15)

Offline

#2 2012-09-04 22:54:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

I guess you will need to provide an alternative...

Why do you want to disable it?

/usr/lib/systemd/system/tmp.mount is probably responsible for the creation.

Do you have a suitable directory on root to be used instead? (Note that I'm not sure this will work but if it is possible to disable this, it will definitely depend on providing /tmp in some other way.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-09-06 09:32:44

BenoitSvB
Member
Registered: 2005-08-13
Posts: 9

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

Thank you for the tip; could very well be the cause; need to track all systemd activities to be sure; will do that next week.
FYI; I want to get rid of tmpfs on /tmp because too often I am caught by surprise when a job aborts because there is no diskspace left on /tmp. When I researched the topic I found an interesting discussion here:
http://lists.debian.org/debian-devel/20 … 01092.html

Last edited by BenoitSvB (2012-09-06 09:33:42)

Offline

#4 2012-09-06 09:46:41

untitaker
Member
Registered: 2011-11-07
Posts: 18

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

You need to remove the corresponding entry in /etc/fstab

Offline

#5 2012-09-06 09:51:09

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

Untested, but something like this may work (and should also be persistent after systemd upgrades):

systemctl mask tmp.mount

Offline

#6 2012-09-06 10:05:02

BenoitSvB
Member
Registered: 2005-08-13
Posts: 9

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

untitaker wrote:

You need to remove the corresponding entry in /etc/fstab

Thanks for the help, but the problem was that tmpfs was mounted on /tmp even though I had done this.

Offline

#7 2012-09-06 10:05:41

BenoitSvB
Member
Registered: 2005-08-13
Posts: 9

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

brain0 wrote:

Untested, but something like this may work (and should also be persistent after systemd upgrades):

systemctl mask tmp.mount

Works like a charm: great solution. Thanks

Offline

#8 2012-09-06 10:11:01

BenoitSvB
Member
Registered: 2005-08-13
Posts: 9

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

cfr wrote:

I guess you will need to provide an alternative...

Do you have a suitable directory on root to be used instead? (Note that I'm not sure this will work but if it is possible to disable this, it will definitely depend on providing /tmp in some other way.)

After "systemctl mask tmp.mount"  and a reboot, my /tmp appears as regularly initialized as part of / without any additional configuring.

Last edited by BenoitSvB (2012-09-06 10:29:49)

Offline

#9 2012-09-06 22:35:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

That's good to know. I have plenty of RAM so tmpfs works well for me but it is always good to have options for other cases!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-12-01 18:10:06

akurei
Member
From: Bochum, NRW, Germany
Registered: 2009-05-25
Posts: 152
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

I disabled tmpfs via fstab AND via systemctl mask tmp.mount and it no longer uses the RAM for /tmp, but now /tmp is no longer cleaned after a reboot. Files in /tmp will survive a reboot. I do not want that. Is there a better way than to rm -rf /tmp/* manually before poweroff/reboot?

Offline

#11 2013-12-01 20:17:16

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

akurei wrote:

I disabled tmpfs via fstab AND via systemctl mask tmp.mount and it no longer uses the RAM for /tmp, but now /tmp is no longer cleaned after a reboot. Files in /tmp will survive a reboot. I do not want that. Is there a better way than to rm -rf /tmp/* manually before poweroff/reboot?

You disabled the unit that gives you the exact functionality you are looking for.  Why don't you want your /tmp on a tmpfs?  Do you have an actual technical reason for it?  If not, why not just leave it as it and let the magic of RAM clean itself out on a reboot?

In any case, if you do have a technical reason for it, then look into tmpfiles.d.

Offline

#12 2013-12-01 21:17:11

akurei
Member
From: Bochum, NRW, Germany
Registered: 2009-05-25
Posts: 152
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

qbittorrent does not work properly when I use a tmpfs, because it first tries to squeeze all torrents in /tmp. Torrents bigger than my tmpfs will trigger a warning by qbittorrent and I have to manually fix it. Also I have about 70 G unused space on my SSD, so I want tmpfs to be on the SSD.
Will look into tmpfiles.d, thanks!

Offline

#13 2013-12-01 21:19:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

Could you not just change your qbittorrent settings so that it downloads elsewhere?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#14 2013-12-01 21:33:07

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

WorMzy wrote:

Could you not just change your qbittorrent settings so that it downloads elsewhere?

The qbittorrent AUR page indicates that this is a bug with magnet links.  Though I don't use it at all, so I cannot confirm. 

Honestly, if my torrent client pulled this kind of shit, I would switch torrent clients.

Offline

#15 2013-12-01 21:36:43

akurei
Member
From: Bochum, NRW, Germany
Registered: 2009-05-25
Posts: 152
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

qbittorrent is actually really good except for this one bug. The alternatives (deluge, rtorrent) suck more.

BTW: Solved the problem like this:

$ cat /etc/tmpfiles.d/tmp.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Clear tmp directories separately, to make them easier to override
D /tmp 1777 root root 0
D /var/tmp 1777 root root 10d

# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-*
x /var/tmp/systemd-private-*
X /tmp/systemd-private-*/tmp
X /var/tmp/systemd-private-*/tmp

Thanks, WonderWoofy

Last edited by akurei (2013-12-02 14:43:26)

Offline

#16 2013-12-01 22:28:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

You should not do it like this as you probably want the defaults to still run.  You probably also want potential changes to the default file to take effect when shipped with systemd.  So instead of fully overriding tmp.conf, instead make a new file name that just includes the /tmp line you have there.  You particularly don't want to clear out /var/tmp unnecessarily, as it is not the same as /tmp. 

I don't know about deluge, but I have used rtorrent in the past, and I find it quite good.  If you don't need crazy advanced features and whatnot, it works great.  But I have since moved to transmission-daemon which I connect to with transmission-remote-cli.  But I have a file server that runs transmission-daemon all the time, so I guess my use case is a bit different.

Offline

#17 2013-12-02 14:43:15

akurei
Member
From: Bochum, NRW, Germany
Registered: 2009-05-25
Posts: 152
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

You are right. I edited my previous post to reflect that.

Offline

#18 2014-09-28 00:15:56

akurei
Member
From: Bochum, NRW, Germany
Registered: 2009-05-25
Posts: 152
Website

Re: [SOLVED] HOWTO disable tmpfs on /tmp?

I know this thread is already months old, but I feel here is the right place to post this:

I tried the steps from this thread today again, because my tmpfs wasn't big enough to build firefox (x86_64) today. These steps no longer work. I commented out the tmpfs line from tmpfs and I masked the systemd file "systemctl mask tmp.mount". The tmpfs is still in RAM.

I feel like I am no longer in control of my system due to systemd. I don't know where to look to disable the tmpfs in RAM. Actually even last time I had to edit *two* places (fstab and the systemd unit file mask) to achieve the desired result. I feel like it is getting worse and I don't like it one bit.

What extra step will I have to do to disable tmpfs in RAM now?

Offline

Board footer

Powered by FluxBB