You are not logged in.

#1 2014-05-12 21:26:31

Dornith
Member
Registered: 2013-02-19
Posts: 84

[SOLVED]How to make udisksctl unmount without prompting for a password

A while ago I pretty much started using commandline for just about everything with file management, to the point where I don't have a file manager installed.  The only problem I've had is that I got tired of manually mounting USBs and I read that fstab was not the proper way to do it.  So I looked into udisks and installed it.  It works wonderfully, except every time I want to unmount a USB I have to type in my password.  I find this rather irritating seeing as I have a button on my keyboard for just that, but it won't work since I can't bind it and enter my password.  Is there any way I can make udisks not require a password?

Edit: Because it seems unclear, at this current point, when I plug in a USB it mounts to my /mnt folder.  When I try this command:

udisksctl unmount -b /dev/sdc1

It asks for a password.  I just need to make it go automatically.

Also, I meant fstab when I typed cfdisk.  My mistake.

Last edited by Dornith (2014-05-13 16:10:47)

Offline

#2 2014-05-12 21:40:43

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

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

sudoers


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-05-12 22:04:17

Dornith
Member
Registered: 2013-02-19
Posts: 84

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

jasonwryan wrote:

sudoers

I thought of that, but I figured there should be some way to just disable asking for passwords since I was able to get it to not require you be in root.

Offline

#4 2014-05-13 08:58:50

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Does the option '--no-user-interaction' prevent the authentication dialog from appearing in your case?

Do you mount external or internal block device file systems?

And it is udisks and udisksctl ; so can you fix the typo in the thread title for a search on 'udisksctl' in the forum to include your thread?

Last edited by berbae (2014-05-13 09:04:32)

Offline

#5 2014-05-13 09:19:42

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

So you can mount (using udisksctl) without a password but then unmount (as the same user with the same active login session) requires a password?

And cfdisk is a partitioning tool?

Offline

#6 2014-05-13 09:54:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Dornith wrote:

I got tired of manually mounting USBs

FYI if you want your USB devices to automount when plugged in, you need more than just udisks. Details in the wiki.

Offline

#7 2014-05-13 13:14:51

Dornith
Member
Registered: 2013-02-19
Posts: 84

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

berbae wrote:

Does the option '--no-user-interaction' prevent the authentication dialog from appearing in your case?

I tried that and got this error:

Error unmounting /dev/sdc1: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorizedCanObtain: Not authorized to perform operation
berbae wrote:

Do you mount external or internal block device file systems?

External.  This is all for USB flash memory drives.

Offline

#8 2014-05-13 14:13:36

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

As Raynman has asked - you mount with udisksctl as user without providing a password and then can't unmount without providing a password?

Offline

#9 2014-05-13 14:37:07

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Please post the command you use to mount the device, and in what login name.

Then post the output of the command 'mount' for the mounted device.

Is there an entry for it in /etc/fstab?

What happens if you try to un-mount it using just the 'umount' command as the user who mounted it?

Last edited by berbae (2014-05-13 14:54:56)

Offline

#10 2014-05-13 14:54:58

Dornith
Member
Registered: 2013-02-19
Posts: 84

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

I'm not issuing any command to mount it.  ldm is doing that for me. 

mount
...
/dev/sdc1 on /mnt/USB type vfat (rw,relatime,uid=1000,gid=100,fmask=0133,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,flush,errors=remount-ro)
...

There is not entry in fstab.  There was, but I removed it.

umount /dev/sdc1
umount: /mnt/USB: umount failed: Operation not permitted

Offline

#11 2014-05-13 15:19:22

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

https://github.com/LemonBoy/ldm/blob/master/README.pod says "ldm -r" should unmount the device - perhaps you should use that?

Offline

#12 2014-05-13 15:23:52

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

If you use ldm to automount, you cannot use udisks to un-mount it.
But ldm has the '-r' option to un-mount:

-r device

    Ask the ldm daemon to unmount the selected device.

Why don't you use this option?

Offline

#13 2014-05-13 15:32:49

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

And if you really want to use udisksctl, you can allow "org.freedesktop.udisks2.filesystem-unmount-others" via polkit (ldm mounts as root and you want to unmount as user). https://wiki.archlinux.org/index.php/Polkit#Examples

Last edited by lucke (2014-05-13 15:34:20)

Offline

#14 2014-05-13 15:45:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Something else worth mentioning: ldm doesn't use udisks at all, so you can remove it if you want.

Offline

#15 2014-05-13 16:10:30

Dornith
Member
Registered: 2013-02-19
Posts: 84

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Hu... I guess somewhere I got it that ldm was a wrapper for udisks.  Well, thanks for the help. 

ldm -r /dev/sdc1

worked perfectly!

Offline

#16 2014-05-13 16:15:57

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]How to make udisksctl unmount without prompting for a password

Yes, you got it from the udisks wiki page. smile

I'll correct it now.

Offline

Board footer

Powered by FluxBB