Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

second Internal hard drive

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
pitt1717
Posts: 4
Joined: 2021-03-01 21:23

second Internal hard drive

#1 Post by pitt1717 »

I have a second 2tb drive for storage. However, if I click on it I always have to provide a admin account password. Is there a way to add my user to a group so when I click on the drive I just see the contents? I don't want to mount it in fstab, just use it almost like I would in windows or mac

mm3100
Posts: 337
Joined: 2020-10-21 21:39
Has thanked: 8 times
Been thanked: 14 times

Re: second Internal hard drive

#2 Post by mm3100 »

I had similar issue, after formatting external hard drive it would require admin password to mount and or use. For me it turned out that owner of the formatted drive was root, as such ordinary user was not able to use it. My solution was to just change its ownership.

Mount the drive and check who is the owner of it, if it is root, just change user and group to your account and you won't have same issues any more.

I don't know if that is best way, it worked for me.

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: second Internal hard drive

#3 Post by CwF »

mm3100 wrote: I don't know if that is best way, it worked for me.
...to many ways!
create a directory with user to mount it in, however you mount it, mount it there, and after its mounted use root to mark the 'others' permissions to read/write...
to many ways.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: second Internal hard drive

#4 Post by Head_on_a_Stick »

pitt1717 wrote:Is there a way to add my user to a group so when I click on the drive I just see the contents?
https://gist.github.com/grawity/3886114 ... nternal-js ← that example allows any user to mount the drive, edit this line to change that.
deadbang

peter_irich
Posts: 1405
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: second Internal hard drive

#5 Post by peter_irich »

This is not a problem. Create any directory on 2nd drive. Make nobody:nogroup the owner if this directory.
Set 0775 permissions on this directory. Include users in group "nogroup".
Tweak 2nd disk mounting in /etc/fstab and any user will be can write in this directory.

Peter.

User avatar
sunrat
Administrator
Administrator
Posts: 6475
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 118 times
Been thanked: 474 times

Re: second Internal hard drive

#6 Post by sunrat »

I've been using this polkit rule to allow mounting in Dolphin without authorisation:
Create a file /etc/polkit-1/localauthority/50-local.d/10-desktop.policy.pkla with this content:

Code: Select all

[Mounting, checking, etc. of internal drives]
Identity=unix-group:admin;unix-group:storage;unix-user:<username>;
Action=org.freedesktop.udisks2.filesystem-*;org.freedesktop.udisks2.drive-ata-smart*
ResultActive=yes
Edit <username> with your own username. I specifically created a storage group for this function and added my user to it. Adapt to taste.
Works in my fresh Bullseye/KDE installation. No fstab edit or permission changes required.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: second Internal hard drive

#7 Post by CwF »

CwF wrote: however you mount it
I said, but meant;
sunrat wrote:Create a file /etc/polkit-1/localauthority/50-local.d/10-desktop.policy.pkla
...so many ways.
Actually you don't need the extra group, just the user name and the list of actions. Of course you can segment it out in any way that fits, multiple pkla files if needed. A single user machine can pack most things in a single rule to just about eliminate any need for sudo.

pitt1717
Posts: 4
Joined: 2021-03-01 21:23

Re: second Internal hard drive

#8 Post by pitt1717 »

@sunrat this is what i was looking for i beleive. i will give it a shot.... TY!



Just added it and it worked! thanks for teaching something new today

Post Reply