Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to mount an internal drive in Plasma with no password?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 611
Location: Almeria, Spain

PostPosted: Fri Jan 15, 2021 12:19 pm    Post subject: How to mount an internal drive in Plasma with no password? Reply with quote

Hi and thanks for reading this!

I just installed an extra SATA drive on my box, where I'm going to backup all my photos. So, I don't want it to mount at every boot up, but only when I need it under my Plasma session.
However, every time I want to mount it (by clicking on its icon in the left side panel of a Dolphin's window), I'm asked for the root password, which is very annoying.
What can I do to just mount my internal SATA drive without being asked for a password? I guess I need to configure some rule somewhere, but I haven't been able to find the solution. Any help is appreciated.
Back to top
View user's profile Send private message
alamahant
l33t
l33t


Joined: 23 Mar 2019
Posts: 807

PostPosted: Fri Jan 15, 2021 12:31 pm    Post subject: Reply with quote

Hi
Please create a file
/etc/polkit-1/rules.d/30-mount-drive.rules

Code:

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
         action.id == "org.freedesktop.udisks2.filesystem-mount") &&
        subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});


Then please run
Code:

usermod -aG wheel $USER


OR
you may try to add the user in the group "disk"
Code:

usermod -aG disk $USER

_________________
:)
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1303
Location: EU or US

PostPosted: Fri Jan 15, 2021 1:00 pm    Post subject: Reply with quote

Bad advice. Very bad advice. User rights should not be elevated to perform such a task. In particular disk group is way over the line. It gives access to the raw devices, effectively giving root rights.
In past it was sufficient to set mount rights in fstab, does Plasma not honor settings in fstab?
Back to top
View user's profile Send private message
alamahant
l33t
l33t


Joined: 23 Mar 2019
Posts: 807

PostPosted: Fri Jan 15, 2021 2:00 pm    Post subject: Reply with quote

@Buffoon
He wants to mount it via dolphin not fstab.
So if dolphin/kde dont take care of perms then someone should..
As he expressed his unwillingness to having had to enter passwd all the time.
GRANTED though the disk group thing is a little overkill and a bad advice.
:)
_________________
:)


Last edited by alamahant on Fri Jan 15, 2021 5:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 16707

PostPosted: Fri Jan 15, 2021 4:58 pm    Post subject: Reply with quote

The traditional way to do this would be to tell fstab that any user may mount the device. I cannot say whether this will be sufficient to get Plasma not to ask for a root password.
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 611
Location: Almeria, Spain

PostPosted: Fri Jan 15, 2021 5:43 pm    Post subject: Reply with quote

alamahant wrote:
@Buffoon
He wants to mount it via dolphin not fstab.
So if dolphin/kde dont take care of perms then someone should..
As he expressed his unwillingness to having had to enter passwd all the time.
GRANTED though the disk group thing is a little overkill and a bad advice.
:)


Thanks very much for your help, @alamahant
Your indication made the trick. I was already in the wheel group so I just needed the rule.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum