Score:1

External SDD mounts as root

cn flag

I have an external SDD drive which I have encrypted with LUKS and formated with ext4 (Label ext225). When I click mount and open, I get the password promt to decrypt the drive and it gets mounted under /media/bruni/ext225. However, it gets mounted as root. Is it possible to get kde to mount this drive as user bruni, each time it gets mounted?

I am on Kubuntu 21.04 with the kde/backports ppa enabled. The drive has no entry in /etc/fstab

cn flag
Ray
Does changing the owner of `/media/bruni` (when it is unmounted) help?
Bruni avatar
cn flag
@Ray No, /media/bruni/ext225 is still user root:root, even after umount and remount.
Score:3
cn flag

Even for removable drives, it is normal that a file system that supports linux permissions is mounted for root. Only file systems not supporting linux permissions will be mounted for the user connecting the drive.

You therefore need to set permissions, either on the mount point if you want to assign the entire drive to a single user, or on selected folders on the drive.

To change ownerschip of the entire drive by changing the ownership of the mount point, execute:

sudo chown $USER:$USER /media/bruni/ext225

$USER is a variable that automatically will be replaced by your login name. Substitute another login to grant ownership to a different user.

Mount points of removable drives are automatically created and removed when the drive is removed. The ownership and permissions, however, are remembered.

Bruni avatar
cn flag
That last sentence, saved me a lot of trouble (even though nautilus is not something you would find on KDE ;-))
vanadium avatar
cn flag
All right, sorry, I overlooked that you are using Kubuntu. I guess `dolphin` will also handle this `admin://` URI? I will adapt the answer. I just want to avoid that people start up their entire file manager as root using `sudo`.
Bruni avatar
cn flag
No, problem. I just was being a smarta... You can revert to the nautilus answer. i used the command line anyway. Btw dolphin does not seem to recognize the admin URI (I get `Unable to create io-slave. klauncher said: Unknown protocol 'admin'.` I did not know that the permissions of these mountpoints get remembered.
vanadium avatar
cn flag
Thank you for the feedback. Then I'd better remove this? This is a drawback of these different graphical environments: it all works differently.
Bruni avatar
cn flag
yes, I would remove the reference to dolphin. And yes, this is the reason why i prefer the terminal for setting things up and the GUI when using.
Irsu85 avatar
cn flag
This was exacly what I needed for Pop OS. Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.