System asking for password when mounting internal hard drive

I have a system with 2 drives, an SSD (250gb) & an HDD (1tb).
latest updates for Manjaro Gnome as of 01/06/2022, with 2 users of which 1 is admin.

The HDD used to be lucks-encrypted, but I formatted it & labelled it ‘Archive’ with Ext4 partitioning through Gparted.
I expected to just click on the drive & use it, but everything I am mounting it, I am asked for the password, as well as when I am copying files onto it.
I have tried to look at permissions & how it works, but I find it very difficult to understand.
Is there a command or simpler way (like a button to tick on a menu) to make the Archive HDD drive accessible by both users, without either of them needing a password to access, read, write & run it?


Edit:
Another part of the answer was written by @winnie, which I copied below.


The file /etc/fstab has entries for what should be mounted at boot (or when invoked). Each entry is six columns.

  1. The device
  2. The mount path (where to mount it)
  3. The filesystem type
  4. The options
  5. If to “dump” (leave it at 0, it’s an obsolete relic)
  6. If/priority to fun a fsck upon boot (for this HDD, leave it at 0)

Just a rough example:

UUID=123456789 /mnt/data ext4 defaults,noatime 0 0

This means mount the block device UUID=123456789 to the path /mnt/data, which is an ext4 filesystem, use the options defaults and noatime, ignore dump, and finally don’t fsck upon boot.

Now when you start your computer, it will be mounted to /mnt/data, which you can access manually, or create a bookmark/shortcut/places entry to quickly navigate to.


What is the permission of the root of the filesystem on the drive?

ls -lha /path/to/mount

Run the above command after you mount the drive.

1 Like

Thank you for your help,

Here’s the output

total 24K
drwxr-xr--   4 denis root 4.0K May 22 00:03 .
drwxr-x---+  3 root  root   60 Jun  1 16:54 ..
drwxr-xr-x  10 root  root 4.0K May 22 01:27 Filme
drwx------   2 root  root  16K May 22 00:01 lost+found

Strange that the folder “Filme” is owned by root.

But the mount point itself shows you own the root directory (highest level) of the filesystem.

This might be a PolKit issue.

Does the same thing happen when you plug in any other USB drive or stick?

1 Like

No it doesn’t ask for a password when I plug in a regular USB, which I guess is what confused me the most.

I can re-format the drive if this would help, but I’ve already done so & the issue is still the same, so I thought I may have done (or am doing) something wrong. Would it help to, and if so, is there a way I can change ownership?

sudo chown -R $USER:$USER /path/to/mount

Or use gnome-disks. I tried it and it perfectly created it there on my usb stick.

grafik

1 Like

The gnome-disks option worked great!

My only issue now is that it still asks for the admin password when mounting the partition. is there a way to mount it automatically without me having to insert the password?

I’m not sure if this is relevant, but I set it so that the system boots automatically into the 2nd user (without admin privileges) when the system starts. Could this be why it does not auto-mount?

Do you have an fstab entry for it? This should negate the need to use the “Removable Devices” method.

Since it’s an internal drive that is always connected, might as well give it an fstab entry.

Could you guide me through, or give me a link on how/what to do? :sweat_smile:

I assume this would be the right page, but again it looks pretty darn completx to do

Just note this:

  • You configured the encrypted drive, so that it is owned by the “admin user”, the normal user won’t have premissions to it.
  • mount actions need root permissions. Polkit has a rule that users who are part of the group wheel wont be asked for a password through udisk2.
  • a normal user would need to ask for password of a different user with admin privs.

Just a question: Why would you disable root privs on the second account? It asks for the password anyway.

2 Likes

How would you know about using LUKS encryption before getting a handle on something more basic like the fstab? :grin:


The guide is on point.

The file /etc/fstab has entries for what should be mounted at boot (or when invoked). Each entry is six columns.

  1. The device
  2. The mount path (where to mount it)
  3. The filesystem type
  4. The options
  5. If to “dump” (leave it at 0, it’s an obsolete relic)
  6. If/priority to fun a fsck upon boot (for this HDD, leave it at 0)

Just a rough example:

UUID=123456789 /mnt/data ext4 defaults,noatime 0 0

This means mount the block device UUID=123456789 to the path /mnt/data, which is an ext4 filesystem, use the options defaults and noatime, ignore dump, and finally don’t fsck upon boot.


Now when you start your computer, it will be mounted to /mnt/data, which you can access manually, or create a bookmark/shortcut/places entry to quickly navigate to.

2 Likes

On top to what @winnie writes, you need to decrypt the disk on boot time with /etc/crypttab.

man crypttab

At the time of the installation I just ticked whether I wanted to have the system encrypted or not :joy: I am very much a noob, though I try to get to learn things, I am by no means proficient enough to have a clue about the details of what I am doing and their detailed impact on my system :sweat_smile:.

I had installed Solus as the OS on that Drive in the past, with time I moved to Manjaro & now I realised I have an old PC which would not be completely unusable had it at least had an SSD; the SSD side is fine, but the HDD was more difficult to access than I am used to, (again, being very much a noob with little time on my hands, it’s a struggle :joy:)

That’s pretty much the whole story : )

Unfortunately I yet again ran out of time, but I will try to do what you suggested as soon as I can!
Thank you for your help, also thanks to @megavolt for the follow-up, I’ll look into that too : )

P.S., only now I’ve seen the comment @megavolt made before;
My initial thought was to make the computer have 2 accounts, one for my parents & one for me. To avoid them risking messing anything up, I thought that if I am the only user with Admin privileges, there’s nothing they can really mess up, but thinking about it again, there’s no way they’d do anything so badly as to mess up the system, so I guess this wasn’t really necessary.

You’re right, I will give the other account Admin privileges too : )

Make a backup of everything right now.

:grimacing: :grimacing: :grimacing:

3 Likes

Right. Since it auto-logins, the user password will only be needed for root actions. So keep the password for yourself and let your parents use it without a password.

Edit: Maybe this could be useful:

sudo usermod --append --groups admin_account parents_account

This way you can keep sure that files, which are owned by you can be accessed by the parents. Better would be creating a custom group for both.

Thank you both @winnie & @megavolt for your help; I’m unsure how to set 2 replies as the solution, so I will edit the initial post mentioning fstab was also part of the solution, & set the picture with “Take Ownership” as the 2nd part.

I will also look into what appending does, but for now I believe that giving ownership of the drive to the 2nd account should work just fine.
I will now do the fstab magic so the drive auto-mounts: thank you so much for the really clear explanation!

Have a great day both of you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.