LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-23-2021, 12:41 PM   #1
gauchao
Member
 
Registered: Dec 2009
Location: Veneto
Distribution: Slackware64
Posts: 366

Rep: Reputation: 143Reputation: 143
/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.

Anybody else has noticed this?

Thank you!
 
Old 07-23-2021, 12:47 PM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,413

Rep: Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149
In /etc/rc.d/rc.S

Code:
# 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

Last edited by marav; 07-23-2021 at 12:50 PM.
 
1 members found this post helpful.
Old 07-23-2021, 01:05 PM   #3
gauchao
Member
 
Registered: Dec 2009
Location: Veneto
Distribution: Slackware64
Posts: 366

Original Poster
Rep: Reputation: 143Reputation: 143
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.
 
1 members found this post helpful.
Old 07-23-2021, 01:07 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by gauchao View Post
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?
 
1 members found this post helpful.
Old 07-23-2021, 01:24 PM   #5
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,413

Rep: Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149
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
Code:
root:~/ # cat /proc/self/mountinfo | grep shared                                                                                                            [20:23:35]
26 28 0:25 / /run rw,nosuid,nodev,noexec,relatime shared:1 - tmpfs tmpfs rw,size=32768k,mode=755,inode64
46 28 0:25 / /var/run rw,nosuid,nodev,noexec,relatime shared:1 - tmpfs tmpfs rw,size=32768k,mode=755,inode64
51 26 0:46 / /run/user/1001 rw,nosuid,nodev,relatime shared:3 - tmpfs tmpfs rw,size=784832k,nr_inodes=196208,mode=700,uid=1001,gid=1001,inode64
52 46 0:46 / /var/run/user/1001 rw,nosuid,nodev,relatime shared:3 - tmpfs tmpfs rw,size=784832k,nr_inodes=196208,mode=700,uid=1001,gid=1001,inode64
481 51 0:70 / /run/user/1001/gvfs rw,nosuid,nodev,relatime shared:2 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1001,group_id=1001
482 52 0:70 / /var/run/user/1001/gvfs rw,nosuid,nodev,relatime shared:2 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1001,group_id=1001
 
1 members found this post helpful.
Old 07-23-2021, 01:31 PM   #6
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,555

Rep: Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415
Quote:
Originally Posted by gauchao View Post
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.
 
3 members found this post helpful.
Old 07-23-2021, 01:46 PM   #7
gauchao
Member
 
Registered: Dec 2009
Location: Veneto
Distribution: Slackware64
Posts: 366

Original Poster
Rep: Reputation: 143Reputation: 143
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.

Quote:
I think because of the "--make-shared" option in /etc/rc.d/rc.S
I see this option and it now makes sense.

Last edited by gauchao; 07-23-2021 at 01:49 PM. Reason: Additional information
 
Old 07-23-2021, 01:48 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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?
 
1 members found this post helpful.
Old 07-23-2021, 01:51 PM   #9
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,555

Rep: Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415
Quote:
Originally Posted by gauchao View Post
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.
 
2 members found this post helpful.
Old 07-23-2021, 01:53 PM   #10
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,555

Rep: Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415
Quote:
Originally Posted by bassmadrigal View Post
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.
 
2 members found this post helpful.
Old 07-23-2021, 02:04 PM   #11
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,413

Rep: Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149Reputation: 4149
Quote:
Originally Posted by bassmadrigal View Post
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)
 
1 members found this post helpful.
Old 07-23-2021, 02:16 PM   #12
gauchao
Member
 
Registered: Dec 2009
Location: Veneto
Distribution: Slackware64
Posts: 366

Original Poster
Rep: Reputation: 143Reputation: 143
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
 
Old 07-23-2021, 02:16 PM   #13
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,555

Rep: Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415
Quote:
Originally Posted by marav View Post
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.
 
2 members found this post helpful.
Old 07-23-2021, 02:19 PM   #14
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,555

Rep: Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415Reputation: 3415
Quote:
Originally Posted by gauchao View Post
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.
 
2 members found this post helpful.
Old 07-23-2021, 02:27 PM   #15
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware64-current fdisk linux partition type 22 instead of 83 and named 'Linux root' instead of 'Linux' gdiazlo Slackware - Installation 9 04-30-2020 04:54 AM
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
[SOLVED] get var value when var name is part of another var bilyboy65 Linux - Newbie 9 10-21-2012 09:32 AM
Kde4 compose stopped working after last current update (slack-13_64) erickFis Slackware 3 01-29-2010 07:24 AM
rm cannot remove /var/run/atd.pid and /var/run/xdm.pid danishmr Linux - Software 1 05-04-2004 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration