You are not logged in.

#1 2012-10-22 14:58:03

tranqil
Member
Registered: 2012-09-06
Posts: 31

Wrong permissions while mounting drives with thunar

Hello board,

today I've try to set up the automounting feature of the thunar filemanager, and it ends up with some problems.
First I got annoying messages while unmounting a mounted flash drive which says: "Failed to eject. Not authorized to perform operation." but the syslog shows the following:

Connecting the drive

Oct 22 16:38:55 localhost kernel: [ 1067.101274] usb 1-1.1: new high-speed USB device number 7 using ehci_hcd
Oct 22 16:38:55 localhost kernel: [ 1067.192977] scsi7 : usb-storage 1-1.1:1.0
Oct 22 16:38:56 localhost kernel: [ 1068.193825] scsi 7:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
Oct 22 16:38:56 localhost kernel: [ 1068.195360] sd 7:0:0:0: [sdb] 62566400 512-byte logical blocks: (32.0 GB/29.8 GiB)
Oct 22 16:38:56 localhost kernel: [ 1068.196347] sd 7:0:0:0: [sdb] Write Protect is off
Oct 22 16:38:56 localhost kernel: [ 1068.197373] sd 7:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Oct 22 16:38:56 localhost kernel: [ 1068.202885]  sdb: sdb1
Oct 22 16:38:56 localhost kernel: [ 1068.206488] sd 7:0:0:0: [sdb] Attached SCSI removable disk
Oct 22 16:39:09 localhost kernel: [ 1081.720341] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)

Here I'm clicking at the flash drive shows up in thunar

Oct 22 16:39:09 localhost udisksd[1763]: Mounted /dev/sdb1 at /run/media/mb/bf3eb5f3-9527-43b0-b5e8-7033402d75c7 on behalf of uid 1000

And here I hit the "umount button" at thunar

Oct 22 16:39:14 localhost udisksd[1763]: Cleaning up mount point /run/media/mb/bf3eb5f3-9527-43b0-b5e8-7033402d75c7 (device 8:17 is not mounted)
Oct 22 16:39:14 localhost udisksd[1763]: Unmounted /dev/sdb1 on behalf of uid 1000

Regarding this log everything is working as intended, but if I hit the "umount button" I got this error message.
Additional - and my main problem - are the wrong permissions to the mounted flash drive, I have read access only.

Filesystem view

[~][#] cd /run/media/mb/
[/run/media/mb][#] ls -la
total 4
drwxr-x---+ 3 root root   60 22.10.2012-16:45 .
drwxr-xr-x  3 root root   60 22.10.2012-16:21 ..
drwxr-xr-x  5 root root 4096 22.10.2012-15:35 bf3eb5f3-9527-43b0-b5e8-7033402d75c7
[/run/media/mb][#] 

The user "mb" is in the storage group, all necessary programs are installed (gnome-disk-utility, polkit-gnome, gvfs, udisksv2..).
I'm starting my 'awesome' session with this command: exec ck-launch-session dbus-launch awesome and I've edited "/etc/polkit-1/localauthority/50-local.d/10-storage-group-mount-override.pkla" as shown in the wiki:

[storage group mount override]
Identity=unix-group:storage
Action=org.freedesktop.udisks2.filesystem-mount
ResultAny=yes
ResultInactive=yes
ResultActive=yes

If I remove this file, or start the awesome wm session without "dbus-launch" I'm not able to usermount anymore.
Last hint: I'm only using this default 'login_cmd' command in slim configuration: exec /bin/bash -login ~/.xinitrc %session

Many thanks in advance!

Offline

#2 2012-10-22 15:38:50

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Wrong permissions while mounting drives with thunar

Regarding the permissions issue: what are the permissions when you mount the partition manually?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-10-22 16:27:52

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

Hi alphaniner,

do you mean manually as user with udisksctl?

[~][$] udisksctl mount -b /dev/sdb1
Mounted /dev/sdb1 at /run/media/mb/bf3eb5f3-9527-43b0-b5e8-7033402d75c7.
[~][$] ls -lad /run/media/mb/bf3eb5f3-9527-43b0-b5e8-7033402d75c7
drwxr-xr-x 6 root root 4096 22.10.2012-19:57 /run/media/mb/bf3eb5f3-9527-43b0-b5e8-7033402d75c7
[~][$] udisksctl unmount -b /dev/sdb1
Unmounted /dev/sdb1.

Last edited by tranqil (2012-10-22 16:29:06)

Offline

#4 2012-10-22 16:42:16

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Wrong permissions while mounting drives with thunar

I mean with mount:

sudo mount /dev/sdb1 /mnt/drive

If you're not familiar with mount, the destination /mnt/drive needs to be an existing folder, preferably empty.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2012-10-22 17:29:03

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

Thank you for the fast reply, but a 'normal' mount as root, is relative unrelated to my problem with the mount as user. Of course, there is no difference:

[~][$] sudo mount /dev/sdb1 /mnt/backup/
[sudo] password for mb: 
[~][$] ls -lahd /mnt/backup/
drwxr-xr-x 6 root root 4,0K 22.10.2012-19:57 /mnt/backup/

Last edited by tranqil (2012-10-22 17:31:59)

Offline

#6 2012-10-22 17:58:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,634

Re: Wrong permissions while mounting drives with thunar

Are you using systemd?
What desktop / window manager are you using?
How do you start that environment?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2012-10-22 18:15:02

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

Hello ewaller, most of this is already explained in my first post:
The window manager is awesome, and is started via slim resp. ~/.xinitrc (exec ck-launch-session dbus-launch awesome) and currently I'm not yet using systemd.

Offline

#8 2012-10-22 18:16:51

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Wrong permissions while mounting drives with thunar

SLiM does not need (and should not have) ck-launch-session in .xinitrc.

archwiki wrote:

Note: slim is ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must no longer include ck-launch-session in your .xinitrc or slim.conf login_cmd. You should still have dbus-launch (see #SLiM_and_Gnome_Keyring) since this gives subprocesses of your session the correct permissions (e.g. to mount something with gvfs-mount, like Pcmanfm does).

https://wiki.archlinux.org/index.php/Slim

Offline

#9 2012-10-22 18:23:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,634

Re: Wrong permissions while mounting drives with thunar

Okay, but what I was leading up to was that if you were using systemd, you might be encountering a conflict with systemd.login and console kit.  As you are not yet using systemd, I won't confuse the issue by going down that rabbit hole smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2012-10-22 18:24:58

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

Without the "ck-launch-session" entry in the xinitrc Thunar doesn't shows mountable or mounted volumes nor remote network shares.
Maybe there is a problem with the order of the sysv init scripts: DAEMONS=(boot-digest-check hwclock syslog-ng acpid laptop-mode crond alsa @network dbus avahi-daemon slim @pcscd @psd @cupsd)?

Last edited by tranqil (2012-10-22 18:27:30)

Offline

#11 2012-10-22 18:26:14

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Wrong permissions while mounting drives with thunar

tranqil wrote:

but a 'normal' mount as root, is relative unrelated to my problem with the mount as user.

The ownership and permissions of files on a Linux filesystem are unrelated to the user who mounted the partition (at least, when mounting 'manually').  I don't use any mount helpers, but it would surprise me if they override own/perms.  Still, I wanted to make sure everything was the same when mounted 'manually'.  The solution is to change ownership of the contents of the filesystem.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

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

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

alphaniner wrote:
tranqil wrote:

but a 'normal' mount as root, is relative unrelated to my problem with the mount as user.

The solution is to change ownership of the contents of the filesystem.

But then I have not the permissions to write to the mounted partitions root directory and this isn't a solutions for using other persons flash media.
And normally I'm using the mount command directly, too. But today I want to set up this Thunar feature, thought it's working out of the box smile

Offline

#13 2012-10-22 18:44:18

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Wrong permissions while mounting drives with thunar

Say you have the partition mounted at /mnt/backup.  You can run

sudo chmod o+w /mnt/backup

to get write permission to the root of the partition.  That would probably be best for 'other person's flash media'.

For your own media, you would run

sudo chown <your username>\: /mnt/backup

and you take ownership of the root of the partition.

Neither of these commands will affect any files and folders that already exist on the partition, but they can be made to do so with the recursive flag.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#14 2012-10-22 20:07:45

tranqil
Member
Registered: 2012-09-06
Posts: 31

Re: Wrong permissions while mounting drives with thunar

Well, of course you are right. But this isn't a solution to this anoying "Failed to eject" message from Thunar. Weird, some minutes ago I tried again to mount the disk with thunar and now I have write permissions. I have nothing changed. I'll try it again after an reboot, later.

Edit: Ok, for some unknown reasons the problems with the missing write permissions are solved. Remains the error message from thunar while hitting the unmount button, but this could be a bug in this release, maybe the timeout waiting for umounting the device (or checking the directory) is too short.

Last edited by tranqil (2012-10-23 07:24:30)

Offline

#15 2012-10-24 21:00:49

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Wrong permissions while mounting drives with thunar

ewaller wrote:

If you were using systemd, you might be encountering a conflict with systemd.login and console kit.

I'm using systemd installed with latest ArchLinux, and XFCE & Thunar. I believe, console kit is deprecated now replaced by PolicyKit. Still having similar issue: when login in as root or a user, all internal SCSI volumes & drives automount with rw permissions by udisks except WinXP volume mounting ro with no remount rw possible.

SOLVED: default ArchLinux install comes with ntfs-fs tool. Install ntfs-3g to avoid the above ro limitations and speedup write ops to NTFS disks.

Last edited by sambul13 (2012-10-24 21:24:32)

Offline

Board footer

Powered by FluxBB