[SOLVED] /var/run/media instead of /run/media after last update in 64-Current
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/var/run/media instead of /run/media after last update in 64-Current
As the title says, in Slackware64-Current, after the last updates, I noticed that my removeable medias are being mounted under /var/run/media instead of /run/media.
I don't remember if there was a symlink before and I don't think I have changed any of these links manually.
# Bind mount /run to /var/run:
mount -o bind /run /var/run
Since
Code:
+--------------------------+
Thu Feb 13 20:17:58 UTC 2020
a/sysvinit-scripts-2.1-noarch-29.txz: Rebuilt.
rc.S: make /var/run a bind mount to /run. Thanks to Robby Workman
Small reminder, especially when using the -current:
It is always important and useful to read the changelog
Yes, this is from 2020. I always watch the changelogs before applying any upgrade especially when "bumps" can occur but I didnīt remember this bind mount.
However, all my removeable units were being mounted as /run/media until yesterday. Today they were mounted as /var/run/media. This has made my automated backup scripts fail, but I can fix them.
Yes, this is from 2020. I always watch the changelogs before applying any upgrade especially when "bumps" can occur but I didnīt remember this bind mount.
However, all my removeable units were being mounted as /run/media until yesterday. Today they were mounted as /var/run/media. This has made my automated backup scripts fail, but I can fix them.
The location it's mounted to shouldn't matter since it's a bind mount. It should show up in both.
Do you have /var/run as a bind mount to /run in your mount output?
I think because of the "--make-shared" option in /etc/rc.d/rc.S
Code:
# If /run exists, mount a tmpfs on it (unless the
# initrd has already done so):
if [ -d /run ]; then
if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then
/sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755,size=32M,nodev,nosuid,noexec
fi
# Make sure that mounts below /run are visible in both /run and /var/run:
/sbin/mount --make-shared /run
fi
As the title says, in Slackware64-Current, after the last updates, I noticed that my removeable medias are being mounted under /var/run/media instead of /run/media.
I don't remember if there was a symlink before and I don't think I have changed any of these links manually.
Anybody else has noticed this?
Thank you!
Yes, it was observed by many - specially when their Plasma5 desktop inexplicably crashes while mounting an USB drive.
The main cause is the Slackware invention of shared binding of /var/run to /run and until now nobody found an explanation for this and why it is useful, while other major distributions just do a symbolic link of /var/run to /run and looks like the various software expects this - we found at least one which did it: Solid-5.84 of Plasma5
IF you want to do the things like everyone else do, there's a small patch for /etc/rc.d/rc.S
Code:
--- rc.S.orig 2021-07-23 11:55:00.234023711 +0300
+++ rc.S 2021-07-23 19:44:55.665037452 +0300
@@ -22,9 +22,11 @@
if [ -d /run ]; then
if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then
/sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755,size=32M,nodev,nosuid,noexec
+ fi
+ # Make sure that /var/run is a symbolic link pointing to /run:
+ if [ ! -L /var/run ]; then
+ (cd /var; rm -rf run; ln -sf ../run run)
fi
- # Make sure that mounts below /run are visible in both /run and /var/run:
- /sbin/mount --make-shared /run
fi
# Load the loop device kernel module:
@@ -367,8 +369,6 @@
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep " ${dev} " ; done
fi
-# Bind mount /run to /var/run:
-mount -o bind /run /var/run
# Enable swapping again. This is needed in case a swapfile is used,
# as it can't be enabled until the filesystem it resides on has been
On the next reboot, the /var/run will be update on the fly as being a symlink to /run and double mounting of your devices magically will disappear.
Also, you will need to apply this patch, or to rebuild the current Solid package with a patch which you can find into Plasma5 thread, if you use Plasma5 and you want to be sure that it does crash inexplicably.
Last edited by LuckyCyborg; 07-23-2021 at 01:46 PM.
Am I misunderstanding bind mounts? I thought that both /var/run and /run will be mirrored. OP is not seeing this, which, to me, says it's not a bind mount. Am I mistaken in that?
Exactly, the device is being "double" mounted under /var/run/media and /run/media, but I don't see anything in my mount output.
In Dolphin, the device shows a mount point under /var/run/media, whether in Thunar it is shown as /run/media.
From cli, I see both mount points coexist.
That's mountpoint from /var/run/media exists and does not exists in the same time, because nobody and nothing mounted something there. In fact, the poor Dolphin mounted your device into /run/media .
I call this Schrodinger's Cat Mountpoint and it's specific to Slackware.
Am I misunderstanding bind mounts? I thought that both /var/run and /run will be mirrored. OP is not seeing this, which, to me, says it's not a bind mount. Am I mistaken in that?
Welcome to Wonderful World of Shared Bind Mounting, which confuses both the users and the programs!
BTW, in the Plasma5 thread I explained that Solid (then Doplhin, Krusader, Konqueror, etc) may chose the mountpoint from /var/run/media instead of the one from /run/media even the application itself mounts the device on /run/media .
You know, I posted dumps from /proc/self/mountinfo of Slackware and openSUSE to explain WHY.
Last edited by LuckyCyborg; 07-23-2021 at 02:27 PM.
Am I misunderstanding bind mounts? I thought that both /var/run and /run will be mirrored. OP is not seeing this, which, to me, says it's not a bind mount. Am I mistaken in that?
I too, until recently, thought that by doing mount you would see :
/dir1 /media/dir1 ....... (rw,.... ,bind)
This is the tail of mount output. I don't see bind in it.
Quote:
/dev/sdc1 on /run/media/removeabledrive/SANDISK64 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
/dev/sdc1 on /var/run/media/removeabledrive/SANDISK64 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro)
Maybe I am using wrong nomenclature about bind mount... sorry. However, inspecting from the command line, I see my removeabledrive is being mounted both under /var/run/media and /run/media, which I learned from Marav that comes from the "--make-shared" option in /etc/rc.d/rc.S. And Dolphin began to display the drive under /var/run/media today whereas yesterday it used to show the drive under /run/media. Both are the same.
Last edited by gauchao; 07-23-2021 at 02:33 PM.
Reason: typo
I too, until recently, thought that by doing mount you would see :
/dir1 /media/dir1 ....... (rw,.... ,bind)
When two directory are mounted with "shared bind", when you mount a device on a subfolder of the first, a second folder and mountpoint will be automatically created on the second.
Technically, on today Slackware every time you mount something on /run that particular device is two times mounted. Secondly into /var/run - this was the root cause of the Plasma5 crashes which was discussed.
Last edited by LuckyCyborg; 07-23-2021 at 02:26 PM.
This is the tail of mount output. I don't see bind in it.
Maybe I am using wrong nomenclature about bind mount... sorry. However, inspecting from the command line, I see my removeabledrive is being mounted both under /var/run/media and /run/media, which I learned from Marav that comes from the "--make-shared" option in /etc/rc.d/rc.S. And Dolphin began to display the drive under /var/run/media today whereas yeaterday it used to show the drive under /run/media. Both are the same.
Long story short, IF you want to fix this double mounting of your pendrive, this is the way: make /var/run a symlink to /run like openSUSE, Ubuntu or Fedora do.
You will need to modify your /etc/rc.d/rc.S too.
Last edited by LuckyCyborg; 07-23-2021 at 02:21 PM.
Just mount device and call df. df is using libmount in contrary to say cat. So parsing /proc/self/mountinfo with cat does not provide correct information about mounts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.