Page 2 of 2

Re: auto mount of partitions

PostPosted: Aug 4th, '11, 18:56
by doktor5000
You deleted the config file and reinstalled policykit?
./dexter11 --verbose --more-details-on-last-post :)

What about:
Code: Select all
id       <- run as user under which you want the mounting to work
cat /etc/polkit-1/localauthority/50-local.d/90-csaba-local-authentication.pkla

Re: auto mount of partitions

PostPosted: Aug 5th, '11, 14:49
by ahmad
/etc/polkit-1 is owned by the polkit package.

@dexter, what happens exactly when you try mounting an internal HDD partition?

Re: auto mount of partitions

PostPosted: Aug 5th, '11, 15:30
by doktor5000
ahmad wrote:/etc/polkit-1 is owned by the polkit package.


Well, yes ... ? The configuration file stays in place, at least with --replacepkgs, tested that here.

Re: auto mount of partitions

PostPosted: Aug 5th, '11, 15:58
by ahmad
I don't think /etc/PolicyKit/PolicyKit.conf has anything to do with polkit.

Code: Select all
$ ps aux | grep polkitd
root      2211  0.0  0.2 186104  5116 ?        Sl   13:28   0:00 /usr/lib64/polkit-1/polkitd
$ rpm -qf /usr/lib64/polkit-1/polkitd
polkit-0.101-5.mga2

Re: auto mount of partitions

PostPosted: Aug 5th, '11, 16:15
by doktor5000
Uhh, well:

Code: Select all
[doktor5000@mageia1 ~]$ rpm -qf /etc/PolicyKit/PolicyKit.conf
policykit-0.9-8.mga1


dexter11 said he changed it, and then GNOME crashed,
so i thought it would be a wise thing to rule out these changes first, no?

Re: auto mount of partitions

PostPosted: Aug 5th, '11, 16:33
by ahmad
IIRC, GNOME (and Nautilus) switched to polkit even before KDE4...

Re: auto mount of partitions

PostPosted: Aug 6th, '11, 09:33
by doktor5000
polkit, PolicyKit, i can't distinguish them. I thought these were 2 names for the same programs.

Re: auto mount of partitions

PostPosted: Aug 6th, '11, 15:20
by dexter11
doktor5000 wrote:You deleted the config file and reinstalled policykit?
./dexter11 --verbose --more-details-on-last-post :)
Yes I did. And thanks to the reinstalling now the default PolcyKit.conf is back.
What about:
Code: Select all
id       <- run as user under which you want the mounting to work
cat /etc/polkit-1/localauthority/50-local.d/90-csaba-local-authentication.pkla


Code: Select all
$ id
uid=500(csaba) gid=500(csaba) csoportok=500(csaba)

csoportok means groups

Code: Select all
# cat /etc/polkit-1/localauthority/50-local.d/90-csaba-local-authentication.pkla
[Local Authentication]
Identity=unix-user:csaba
Action=org.freedesktop.udisks.filesystem-mount-system-internal
ResultActive=yes

Re: auto mount of partitions

PostPosted: Aug 6th, '11, 15:54
by dexter11
ahmad wrote:/etc/polkit-1 is owned by the polkit package.

@dexter, what happens exactly when you try mounting an internal HDD partition?

I write down the whole process in case it makes a difference.
So first I start diskdrake, click on the partition I want to unmount and then click on unmount. I realize it must be the same as writing umount on the command line but I prefer GUIs these days.
I leave diskdrake running and then launch Nautilus. Click on the recently unmounted partition and this is what I get:
Image

Before I made any modifications to any file Nautilus asked for the root password instead of just giving an error message.

Re: auto mount of partitions

PostPosted: Aug 6th, '11, 16:30
by doktor5000
Now this is another problem: IIRC, you can't have it both ways, either you use fstab entries, or you use dynamic mounting by means of your desktop environment.
Could you backup your current fstab, remove the entries for the partitions you want to mount, and try again and show the error message?

Re: auto mount of partitions

PostPosted: Aug 6th, '11, 17:01
by ahmad
Yep, udisks (and hal) won't/can't mount partitions that have /etc/fstab entries.

Re: auto mount of partitions

PostPosted: Aug 7th, '11, 15:11
by dexter11
Removed all those partitions from fstab and when I click on them Nautilus mounts them without any error messages or authentications. Hurray!

Now how can I setup the system so it does the mounting of these partitions automatically at boot or when Gnome starts?

Re: auto mount of partitions

PostPosted: Aug 7th, '11, 15:28
by doktor5000

Re: auto mount of partitions

PostPosted: Aug 9th, '11, 16:32
by dexter11
Actually udisks doesn't automatically mount anything
So it's not possible.

Thank you for all your help.

Re: auto mount of partitions

PostPosted: Aug 9th, '11, 18:37
by doktor5000
Well, that is wrong, your quoting misses the important part:

Actually udisks doesn't automatically mount anything - the way it works
is that the desktop session is responsible for deciding if a mountable
filesystem is to be automatically mounted
. It sounds really easy to do
this but experience has shown that you need to be very careful.

Anyway, for GNOME, Nautilus is in charge of that. Nautilus basically, on
startup and when a new GVolume is announced, just checks the result of
g_volume_should_automount()
[...]


But i'm not into Nautilus, and i'm not sure this can be done without changing some source
code. I also don't know where to change these settings, as i don't use GNOME.

Re: auto mount of partitions

PostPosted: Aug 10th, '11, 18:43
by dexter11
I checked the links in that mail and two of them points to C source code. So I assume that if I want to achieve automount with PolicyKit and udisks then I should fix the source and recompile. That just won't happen. It's much easier to create and use fix mount points.

Re: auto mount of partitions

PostPosted: Aug 10th, '11, 19:12
by doktor5000
Well, my logic tells me if there is a flag called "volume_should_automount" then there SHOULD
be a way for the user to specify this for some of his volumes. For example in KDE you can switch
automounting on for all removable media. or only for media that were already connected to your box
or only for specific ones.

That should also be doable in GNOME, but i don't know that. Some GNOME user must help you there.
If not, i'm installing GNOME right now and looking after this, you got me interested.

Re: auto mount of partitions

PostPosted: Mar 18th, '12, 23:22
by jaywalker
oops, posted in wrong place

Re: [SOLUTION] mount internal partitions - permission proble

PostPosted: Dec 14th, '14, 20:21
by doktor5000
FWIW, someone put the policy file content in the wiki: https://wiki.mageia.org/en/Useful_polki ... t_password