Mailinglist Archive: opensuse (1239 mails)

< Previous Next >
Re: [opensuse] How should one make /media a tmpfs under 12.3?
Carlos E. R. said the following on 06/28/2013 02:38 PM:
Hash: SHA1

On Friday, 2013-06-28 at 12:59 -0400, Anton Aylward wrote:
Andrey Borzenkov said the following on 06/28/2013 06:11 AM:
On Fri, Jun 28, 2013 at 1:50 PM, Carlos E. R. <> wrote:

So long as it is in /etc/tmp*.d/<whatver> or the /usr/lib equivalent it will
be recreated by systemd-tmpfiles on every boot. As the man page says, you've
read that, I presume, if you don't want that action you symlink the relevant
filename to /dev/null.

I don't understand this. Symlink /media to dev/null?

Symlink the appropiate /etc/tmp*.d/<whatver> or the /usr/lib equivalent to /dev/null like it says in thee man page:

If the administrator wants to disable a configuration file supplied by the vendor the recommended way is to place a symlink to /dev/null in /etc/tmpfiles.d/ bearing the same file name.


Carlos, the only way you will stop that is to remove the relevant file or
symlinking it.

If you want /media to be a tmpfs as is

# mount | grep tmpfs

devtmpfs on /dev type devtmpfs
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)

/run then look how /run gets created.
Its done with systemd, of course :-)

That is precisely what I did. I looked some documentation, which I did
not comprehend properly, then did:

grep: /*.conf: No such file or directory
/usr/lib/tmpfiles.d/clamav.conf:# clamav needs a directory in /var/run:
/usr/lib/tmpfiles.d/clamav.conf:d /var/run/clamav 0755 vscan vscan -
/usr/lib/tmpfiles.d/legacy.conf:# systems. /run/lock/subsys is used for
serializing SysV service
/usr/lib/tmpfiles.d/legacy.conf:# /run/lock/lockdev is used to serialize access
to tty devices via
/usr/lib/tmpfiles.d/legacy.conf:# changed for openSUSE : only /run/lock should
be available
/usr/lib/tmpfiles.d/legacy.conf:d /run/lock 0775 root lock -
/usr/lib/tmpfiles.d/legacy.conf:#d /run/lock/subsys 0755 root root -
/usr/lib/tmpfiles.d/legacy.conf:#d /run/lock/lockdev 0775 root lock -
/usr/lib/tmpfiles.d/nscd.conf:d /var/run/nscd 0755 root root
/usr/lib/tmpfiles.d/screen.conf:# Screen needs some files in /var/run:
/usr/lib/tmpfiles.d/screen.conf:d /var/run/screens 0755 root root -
/usr/lib/tmpfiles.d/screen.conf:d /var/run/uscreens 1777 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/user 0755 root root ~10d
/usr/lib/tmpfiles.d/systemd.conf:F /run/utmp 0664 root utmp -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/ask-password 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/seats 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/sessions 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/users 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/shutdown 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:F /run/nologin 0755 - - - "System is booting

to find some examples. But you see, there is no entry there for "/run" or
"/var/run", so I took the example from a wrong entry.

I have
$ ls -l /usr/lib/tmpfiles.d/tmp.conf
-rw-r--r-- 1 root root 564 Jun 13 05:50 /usr/lib/tmpfiles.d/tmp.conf

and it reads

# 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 10d
d /var/tmp 1777 root root 30d

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

So THAT is responsible for creating and cleaning /tmp

If I want to turn that off I create
/etc/tmpfiles.d/tmp.conf symlinked to /dev/null
just like the man page recommends.

On my 12.3 (recently upgraded) system that is
/usr/lib/systemd/system/var-run.mount for the tmpfs on /var/run
var-lock.mount for the tmpfs on /var/lock

So you have a bind-mount there :-)
You could bind-mount to /dev/shm -- people used to do that :-)

Ah. Indeed. So it is not created the way I thought, it is created directly
by a service!

# ls -dli /run /var/run
2429 drwxr-xr-x 23 root root 720 Jun 28 11:49 /run
2429 drwxr-xr-x 23 root root 720 Jun 28 11:49 /var/run

So why isn't/usr/lib/systemd/system/tmp.mount being used?
Cristian has pointed out previously in this list that openSuse has been
modified so that it isn't. HOW? you ask? That is what Andrey has been
telling you!

Because /usr/lib/tmpfiles.d/tmp.conf is creating them first.

Ok, so if I want /media to be a tmpfs, either I bind-mount it to
somewhere, or create it with a service like
"/etc/systemd/system/media.mount similar to


IIRC my (presently off line) RH system is like that.

The -bind is the old, old way of doing it
but you can do that with a .mount as I referenced and make it 'systemd clean'.

However I'd start from systemd :-)

More discussion at

Isn't google wonderful?

But don't forget this thread

Hmm, no, "/usr/lib/systemd/system/var-run.mount" creates a bind from
"/run" to /var/run". Then where is "/run" created?

I could, then, create a directory under "/run", and mount-bind "/media" to
it. Or create an entire new tmpfs.


- --
Carlos E. R.
(from 12.3 x86_64 "Dartmouth" at Telcontar)

Version: GnuPG v2.0.19 (GNU/Linux)


How long did the whining go on when KDE2 went on KDE3?

The only universal constant is change. If a species can not adapt it
goes extinct. That's the law of the universe, adapt or die.
-- Billie Walsh, May 18 2013
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups