You are not logged in.

#1 2012-12-10 22:15:25

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Mount issues, etc after recent updates

I don't mount USB drives every day so I'm not sure when this happened. I've been running arch for some time now and have transitioned away from HAL to udev as well as moving to systemd as the system has demanded the changes take place.

At this point, when I insert a USB key and allow it to 'auto-mount' things just don't seem to work right.  For one, Thunar doesn't even see them.  The bigger issue is that they are unusable:

[2012.12.10]-[benito]-=(darkhouse)=-[pts/28]-[~/documents] 
[17:07:59]$ ls -lah /media/32GKEY 
ls: cannot access /media/32GKEY: Transport endpoint is not connected
[2012.12.10]-[benito]-=(darkhouse)=-[pts/28]-[~/documents] 
[17:12:00]$ ls -lah /media/|grep 32GKEY
ls: cannot access /media/32GKEY: Transport endpoint is not connected
d?????????   ? ?      ?         ?            ? 32GKEY

I am guessing this is due to a permissions issue however I'm not 100% sure where.  If I manually run the mount command as root it works fine.

I thought that I might be able to save time by asking here.  Things have changed over the years to the point where I am not 100% sure what is controlling this at this point ... thunar isn't anymore, that's for sure.

Also, while this one drive does pick up the label, most don't seem to anymore and I end up with 'usbhd-sd*' directories that things get mounted to rather than it autocreating the dir for their label.  I've made so many tweaks over the years to keep up with changes that I'm not sure why this is at this point.

Thanks in advance

B

Last edited by becatlibra (2012-12-10 22:43:22)

Offline

#2 2012-12-10 22:23:33

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,443

Re: Mount issues, etc after recent updates

There are dozens of thread concerning auto-mounting not working. The first and most important question, are you booting with systemd. If not you've got some reading to do.

Offline

#3 2012-12-10 22:33:18

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

...and have transitioned away from HAL to udev...

uhm, what? you did that just now, seriously? HAL has been deprecated for years...

anyway... on topic: my guess is that this is yet another case of crappy udev automount rules in /etc/udev/rules.d/.

Offline

#4 2012-12-10 22:35:32

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

Yes I realize that there are dozens (I would guess more) of threads concerning automounting not working.  I've had issues with automounting not working before many times as things have changed with arch over the years.  As this recent issue is recent (since the shift to systemd) I am guessing it's related to that possibly.

I am booting with systemd via setting init in the grub config:

kernel /boot/vmlinuz26 root=/dev/disk/by-label/root ro init=/usr/lib/systemd/systemd

-B

Offline

#5 2012-12-10 22:39:26

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

...and have transitioned away from HAL to udev...

uhm, what? you did that just now, seriously? HAL has been deprecated for years...

anyway... on topic: my guess is that this is yet another case of crappy udev automount rules in /etc/udev/rules.d/.

Actually no, the switch away from HAL happened some time ago.  Just more rambling or providing that as reference.  I do have a udev rule that I placed in that location back in March which fixed an issue that I was having.  The 'Transport endpoint is not connected' and not being able to see the contents or permissions of the mount point is a new thing.

For reference, the udev rule that I have is as follows:

/etc/udev/rules.d/11-media-by-label-auto-mount.rules

# https://wiki.archlinux.org/index.php/Udev
# Start at sdb to avoid system harddrive. 
KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"

# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"

# Exit
LABEL="media_by_label_auto_mount_end"

Offline

#6 2012-12-10 22:42:00

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

Yes, these are the crappy udev automount rules I am talking about. Delete them and install udisks2.

Offline

#7 2012-12-10 22:47:12

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

Yes, these are the crappy udev automount rules I am talking about. Delete them and install udisks2.

So, you honestly think that the issues I described initially of not being able to list the contents of an automounted drive, getting the 'Transport endpoint is not connected' as well as not even being able to see the permissions of the mount via an 'ls':

[2012.12.10]-[benito]-=(darkhouse)=-[pts/28]-[~/documents] 
[17:07:59]$ ls -lah /media/32GKEY 
ls: cannot access /media/32GKEY: Transport endpoint is not connected

[2012.12.10]-[benito]-=(darkhouse)=-[pts/28]-[~/documents] 
[17:12:00]$ ls -lah /media/|grep 32GKEY
ls: cannot access /media/32GKEY: Transport endpoint is not connected
d?????????   ? ?      ?         ?            ? 32GKEY

Could actually be caused by the udev rules I have in place?

Offline

#8 2012-12-10 22:58:29

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

Yes, these are the crappy udev automount rules I am talking about. Delete them and install udisks2.

Okay, removed the udev script.  I already had 'udisks2' installed and running (verified with systemctl).  I restarted systemd-udevd.service, systemd-udev-trigger.server and udisks2.  Put the USB drive in and while dmesg shows it to me as seen, no automounting magic is taking place.

Surely then there must be more to your suggestion.  Likely udisks2 needs to be configured just like udev did.  I forgot to mention, I'm not a big fan of GNOME or KDE (I run WMII) and from the article on udev (which is where I got the rule that I was using, from) it looks like that's where udisks may be required ... https://wiki.archlinux.org/index.php/Udev

I'm open to other ideas.  At this point, with the remove of the UDEV rule that I got from the wiki, nothing automounts at all...

-B

Offline

#9 2012-12-10 23:04:41

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

try a reboot, thunar should at least list them in the sidebar and you should be able to mount them. If you get an authorization error you are probably not in an active logind session (which has been discussed in over 9000 threads since the ConsoleKit -> logind switch and I honestly don't feel like explaining it anymore).

Otherwise try one of the many udisks wrappers mentioned on the udev wiki page...

Offline

#10 2012-12-10 23:09:52

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

try a reboot, thunar should at least list them in the sidebar and you should be able to mount them. If you get an authorization error you are probably not in an active logind session (which has been discussed in over 9000 threads since the ConsoleKit -> logind switch and I honestly don't feel like explaining it anymore).

Otherwise try one of the many udisks wrappers mentioned on the udev wiki page...

I do have an active logind session.  That is one of the first things that I checked in looking into this.  I remember the transition from ConsoleKit (PolKit, etc) to logind as one of the positive things related to having to transition from init scripts (which are still the standard in the hundreds of CentOS servers I login to each week) to systemd.

I'll give a reboot a shoot now and see what shakes out.

-B

Offline

#11 2012-12-10 23:20:30

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

So yes, rebooting did not fix it.  dmesg shows the drive

[  108.973269] usb 1-2.1: USB disconnect, device number 7
[  115.813390] usb 1-6.1: new high-speed USB device number 8 using ehci_hcd
[  115.897919] scsi5 : usb-storage 1-6.1:1.0
[  116.901038] scsi 5:0:0:0: Direct-Access     SanDisk  Cruzer Glide     1.26 PQ: 0 ANSI: 5
[  116.902553] sd 5:0:0:0: [sdd] 62530624 512-byte logical blocks: (32.0 GB/29.8 GiB)
[  116.903774] sd 5:0:0:0: [sdd] Write Protect is off
[  116.903778] sd 5:0:0:0: [sdd] Mode Sense: 43 00 00 00
[  116.904529] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  116.914039]  sdd: sdd1
[  116.916899] sd 5:0:0:0: [sdd] Attached SCSI removable disk

However 'thunar' does not show the device in the sidebar and it was not automounted.  With the udev rule I had in place (which was recommended via the arch wiki) automount did happen however permissions seemed wonky.  Looks like since I'm not using GNOME or KDE udisk does not auto-work so to speak ... WMII is a completely different beast which doesn't involve a lot of the bloated backend services that KDE and GNOME tend to rely on..  I guess I'll try to figure this out myself.  While you are giving advice, you don't really seem to want to help but rather seem kind of annoyed by me even asking for help.  In my experience, the arch community was always rather helpful in the time I've been here (part of the reason I chose arch).  It seems like, lately, there is more frustration and less help

Oh well.

-B

Offline

#12 2012-12-10 23:27:49

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Mount issues, etc after recent updates

becatlibra wrote:

It seems like, lately, there is more frustration and less help

That is really only because this has been covered to death.

65kid's suggestions are good. Make sure you also don't have any .pkla files trying to do the same thing. The easiest way to get this to work is to remove everything else you have tried, make sure your session is active and use nothing other than a udisks wrapper to sort it out. It will work without issue.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2012-12-10 23:31:40

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

becatlibra wrote:

However 'thunar' does not show the device in the sidebar and it was not automounted.  With the udev rule I had in place (which was recommended via the arch wiki) automount did happen however permissions seemed wonky.  Looks like since I'm not using GNOME or KDE udisk does not auto-work so to speak ... WMII is a completely different beast which doesn't involve a lot of the bloated backend services that KDE and GNOME tend to rely on..  I guess I'll try to figure this out myself.  While you are giving advice, you don't really seem to want to help but rather seem kind of annoyed by me even asking for help.  In my experience, the arch community was always rather helpful in the time I've been here (part of the reason I chose arch).  It seems like, lately, there is more frustration and less help

didn't mean to seem annoyed by you, sorry, it's just that this topic has been beaten to death lately... wink
not sure what is going on there, I use only the i3 window manager myself with thunar and it mounts my devices just fine (and as I just noticed, it even does automount when it is set in thunar-volman-settings, meaning you shouldn't need an udisks wrapper).

post the output of the following:

loginctl show-session $XDG_SESSION_ID
systemctl status udisks2 polkit

Offline

#14 2012-12-11 15:17:16

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:
becatlibra wrote:

However 'thunar' does not show the device in the sidebar and it was not automounted.  With the udev rule I had in place (which was recommended via the arch wiki) automount did happen however permissions seemed wonky.  Looks like since I'm not using GNOME or KDE udisk does not auto-work so to speak ... WMII is a completely different beast which doesn't involve a lot of the bloated backend services that KDE and GNOME tend to rely on..  I guess I'll try to figure this out myself.  While you are giving advice, you don't really seem to want to help but rather seem kind of annoyed by me even asking for help.  In my experience, the arch community was always rather helpful in the time I've been here (part of the reason I chose arch).  It seems like, lately, there is more frustration and less help

didn't mean to seem annoyed by you, sorry, it's just that this topic has been beaten to death lately... wink
not sure what is going on there, I use only the i3 window manager myself with thunar and it mounts my devices just fine (and as I just noticed, it even does automount when it is set in thunar-volman-settings, meaning you shouldn't need an udisks wrapper).

post the output of the following:

loginctl show-session $XDG_SESSION_ID
systemctl status udisks2 polkit

I appreciate any help you can give.  I'd rather not add *more* to the mix (such as udisk wrappers) if I can simply make it work more easily.  My .wmiirc starts thunar with the --daemon option as well which I had thought would make this work regardless however it simply does not seem to be.  Here is the info from the command you mentioned:

[2012.12.10]-[benito]-=(darkhouse)=-[pts/0]-[~] 
[18:17:02]$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Mon, 2012-12-10 18:14:21 EST
TimestampMonotonic=49346735
DefaultControlGroup=name=systemd:/user/benito/1
VTNr=7
Display=:0.0
Remote=no
RemoteUser=root
Service=slim
Leader=441
Audit=1
Type=x11
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=benito
[2012.12.11]-[benito]-=(darkhouse)=-[pts/0]-[~] 
[10:14:07]$ systemctl status udisks2 polkit
udisks2.service - Disk Manager
	  Loaded: loaded (/usr/lib/systemd/system/udisks2.service; static)
	  Active: inactive (dead)
	    Docs: man:udisks(8)
	  CGroup: name=systemd:/system/udisks2.service


polkit.service - Authorization Manager
	  Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
	  Active: inactive (dead)
	    Docs: man:polkit(8)
	  CGroup: name=systemd:/system/polkit.service

Thanks again for any help that you can give

-B

Offline

#15 2012-12-11 15:25:23

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

there is your problem, udisks2 and polkit are not running. They are both dbus-activated, so I guess you don't have dbus running in your user session. Make sure you use the .xinitrc from /etc/skel and only add "exec wmii" at the end of the file. If this still doesn't work, post the output of "systemctl status dbus.service dbus.socket" and your ~/.xinitrc.

Offline

#16 2012-12-11 15:34:41

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

there is your problem, udisks2 and polkit are not running. They are both dbus-activated, so I guess you don't have dbus running in your user session. Make sure you use the .xinitrc from /etc/skel and only add "exec wmii" at the end of the file. If this still doesn't work, post the output of "systemctl status dbus.service dbus.socket" and your ~/.xinitrc.

I did have dbus items in my .xinitrc but when I performed the switch over to systemd (logind, etc) I commented the lines out as my understanding was they were not needed anymore.  I left them in the file, as I usually do, commented out just in case I needed the reference at some point.

~/.xinitrc

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
# exec terminator

# added to fix automount issue 
# https://bbs.archlinux.org/viewtopic.php?pid=880426#p880426

#if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
#	eval `dbus-launch --sh-syntax --exit-with-session`
#fi
#

# in theory, thanks to systemd (and logind) consolekit should not be
#   needed anymore and dbus should 'just happen' so removing the following
#   four lines
# exec ck-launch-session dbus-launch wmii
# until wmii; do
#   true
# done
exec wmii

As you can see, all that is there is the exec wmii.  Here is the output of the systemctl command you asked me to run as well:

[2012.12.11]-[benito]-=(darkhouse)=-[pts/0]-[~] 
[10:29:17]$ systemctl status dbus.service dbus.socket
dbus.service - D-Bus System Message Bus
	  Loaded: loaded (/usr/lib/systemd/system/dbus.service; static)
	  Active: active (running) since Mon, 2012-12-10 18:14:02 EST; 16h ago
	Main PID: 429 (dbus-daemon)
	  CGroup: name=systemd:/system/dbus.service
		  └─429 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation


dbus.socket - D-Bus System Message Bus Socket
	  Loaded: loaded (/usr/lib/systemd/system/dbus.socket; static)
	  Active: active (running) since Mon, 2012-12-10 18:14:02 EST; 16h ago
	  CGroup: name=systemd:/system/dbus.socket

I noticed that I also have udisks in addition to udisks2.  This is also loaded, inactive (dead)

udisks.service - UDisks
	  Loaded: loaded (/usr/lib/systemd/system/udisks.service; disabled)
	  Active: inactive (dead)
	  CGroup: name=systemd:/system/udisks.service

Not sure if that makes any difference.  I'm guessing that I should probably remove one of those two though?

Thanks again for having patience with me

-B

Offline

#17 2012-12-11 15:40:12

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: Mount issues, etc after recent updates

I did have dbus items in my .xinitrc but when I performed the switch over to systemd (logind, etc) I commented the lines out as my understanding was they were not needed anymore.

it is still needed, it's just that the default .xinitrc from /etc/skel does it for you (it loops over /etc/X11/xinit/xinitrc.d/ which contains a file that starts dbus). As mentioned, use /etc/skel/.xinitrc and add nothing but "exec wmii".

udisks and udisks2 can be installed side-by-side, but you may just as well remove udisks if you have no packages that depend on it.

Offline

#18 2012-12-11 15:49:46

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

I did have dbus items in my .xinitrc but when I performed the switch over to systemd (logind, etc) I commented the lines out as my understanding was they were not needed anymore.

it is still needed, it's just that the default .xinitrc from /etc/skel does it for you (it loops over /etc/X11/xinit/xinitrc.d/ which contains a file that starts dbus). As mentioned, use /etc/skel/.xinitrc and add nothing but "exec wmii".

udisks and udisks2 can be installed side-by-side, but you may just as well remove udisks if you have no packages that depend on it.

Sorry I missed the bit about copying that over.  I have copied it over however I'm going to need to wait to test.  I've got a pile of work to get done and too many shell sessions open right now to restart things.

I'll ping back when I've had a chance to test.

Thanks again for all your help

B

Offline

#19 2012-12-11 23:12:29

becatlibra
Member
Registered: 2010-06-25
Posts: 61

Re: Mount issues, etc after recent updates

65kid wrote:

I did have dbus items in my .xinitrc but when I performed the switch over to systemd (logind, etc) I commented the lines out as my understanding was they were not needed anymore.

it is still needed, it's just that the default .xinitrc from /etc/skel does it for you (it loops over /etc/X11/xinit/xinitrc.d/ which contains a file that starts dbus). As mentioned, use /etc/skel/.xinitrc and add nothing but "exec wmii".

udisks and udisks2 can be installed side-by-side, but you may just as well remove udisks if you have no packages that depend on it.

Alrighty!  I'm 90% of the way there.  After copying that .xinitrc from /etc/skel with it's xinitrc.d loop and rebooting, the USB key is seen by 'Thunar' as you mentioned it should be.  It does not automount, however clicking it in 'Thunar' does mount the drive...  oddly, it mounts to /run/media/$username/$label, ex:

[2012.12.11]-[benito]-=(darkhouse)=-[pts/2]-[/run/media/benito] 
[18:11:15]$ mount |grep sdd
/dev/sdd1 on /run/media/benito/32GKEY type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

I checked the status of udisk2 and polkit and they are both reporting as operational as expected:

[2012.12.11]-[benito]-=(darkhouse)=-[pts/3]-[~] 
[18:05:56]$ systemctl status udisks2 polkit
udisks2.service - Disk Manager
	  Loaded: loaded (/usr/lib/systemd/system/udisks2.service; static)
	  Active: active (running) since Tue, 2012-12-11 18:07:34 EST; 1min 53s ago
	    Docs: man:udisks(8)
	Main PID: 3774 (udisksd)
	  CGroup: name=systemd:/system/udisks2.service
		  ├─3774 /usr/lib/udisks2/udisksd --no-debug
		  └─4625 /usr/bin/mount.ntfs /dev/sdd1 /run/media/benito/32GKEY -o rw,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177,uhelper=udisks2


polkit.service - Authorization Manager
	  Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
	  Active: active (running) since Tue, 2012-12-11 18:07:34 EST; 1min 53s ago
	    Docs: man:polkit(8)
	Main PID: 3778 (polkitd)
	  CGroup: name=systemd:/system/polkit.service
		  └─3778 /usr/lib/polkit-1/polkitd --no-debug

Can you tell me, is this the expected behavior of udisks2?  It just seems odd that it's in /run/media instead of just /media. 

Also, automounting still doesn't happen... not the end of the world by any means, it's a lot better now that it was and I really appreciate the patience and help however it would be awesome if I could get that operating as well.  I am wondering if I do indeed need a wrapper to get the automount working as intended

Thanks

B

Last edited by becatlibra (2012-12-11 23:16:04)

Offline

#20 2012-12-11 23:14:46

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Mount issues, etc after recent updates

Yes /run/media/$USER is the normal mount location for udisks2.

Offline

Board footer

Powered by FluxBB