second Internal hard drive

New to Debian (Or Linux in general)? Ask your questions here!

second Internal hard drive

Postby pitt1717 » 2021-03-01 21:27

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
pitt1717
 
Posts: 4
Joined: 2021-03-01 21:23

Re: second Internal hard drive

Postby mm3100 » 2021-03-02 01:47

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.
mm3100
 
Posts: 77
Joined: 2020-10-21 21:39

Re: second Internal hard drive

Postby CwF » 2021-03-02 02:05

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.
CwF
 
Posts: 952
Joined: 2018-06-20 15:16

Re: second Internal hard drive

Postby Head_on_a_Stick » 2021-03-02 14:48

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.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: second Internal hard drive

Postby peter_irich » 2021-03-02 17:28

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.
peter_irich
 
Posts: 1317
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: second Internal hard drive

Postby sunrat » 2021-03-02 20:41

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!
User avatar
sunrat
 
Posts: 3482
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: second Internal hard drive

Postby CwF » 2021-03-02 21:07

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.
CwF
 
Posts: 952
Joined: 2018-06-20 15:16

Re: second Internal hard drive

Postby pitt1717 » 2021-03-02 21:46

@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
pitt1717
 
Posts: 4
Joined: 2021-03-01 21:23


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable