You are not logged in.

#1 2014-10-18 19:29:30

pabloski
Member
Registered: 2007-03-14
Posts: 31

USB pendrives, mounting and permissions

Hi, I have a fresh installation of Arch with LXDE. Today I noted that it is impossible to mount an ext filesystem on pendrives, hard drives, etc... as a normal user. Ok it works, it asks for my password and mounts it, but under the root user and group! It means I cannot copy files ( at least in a simple and logical way ) to the mounted partition. And I know that for NTFS and FAT filesystems it works.

I have searched on the web and on the Arch forum, I have also checked with a Manjaro installation that I have on another computer and it works the same way. From what I understand it is working as intended and it is not an erroneous behaviour.

Also I know that I can set the user option in fstab to make the system mount my partitions as a normal user, but I cannot add each and every pendrive that I will use to fstab. So, is it possible to configure the system to mount ( by default ) ext partitions as a normal user?

Offline

#2 2014-10-18 19:40:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: USB pendrives, mounting and permissions

What is doing the mounting and who owns the mount point?


Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-10-18 21:43:25

pabloski
Member
Registered: 2007-03-14
Posts: 31

Re: USB pendrives, mounting and permissions

jasonwryan wrote:

What is doing the mounting and who owns the mount point?

Thanks for the reply.

The user doing the mounting is the non root user I have created. The mount point is dynamically generated is /run/media/username.

Offline

#4 2014-10-18 21:50:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: USB pendrives, mounting and permissions

pabloski wrote:
jasonwryan wrote:

What is doing the mounting and who owns the mount point?

The mount point is dynamically generated is /run/media/username.

So, presumably is it udisks2? https://wiki.archlinux.org/index.php/Udisks


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-10-19 08:40:11

pabloski
Member
Registered: 2007-03-14
Posts: 31

Re: USB pendrives, mounting and permissions

jasonwryan wrote:
pabloski wrote:
jasonwryan wrote:

What is doing the mounting and who owns the mount point?

The mount point is dynamically generated is /run/media/username.

So, presumably is it udisks2? https://wiki.archlinux.org/index.php/Udisks

Yes udisks2.

Offline

#6 2014-10-19 10:03:36

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: USB pendrives, mounting and permissions

Ownership and permissions are included in EXT filesystems, unlike NTFS/FAT. If you want your user to have access, just use chown/chmod as required.

Offline

#7 2014-10-19 10:05:18

pabloski
Member
Registered: 2007-03-14
Posts: 31

Re: USB pendrives, mounting and permissions

tomk wrote:

Ownership and permissions are included in EXT filesystems, unlike NTFS/FAT. If you want your user to have access, just use chown/chmod as required.

Can I change the default mount options for an ext4 filesystem using tune2fs?

Offline

#8 2014-10-19 14:24:29

pabloski
Member
Registered: 2007-03-14
Posts: 31

Re: USB pendrives, mounting and permissions

Hi, I have found a solution, so I'll report it here if someone needs it too.

Systemsd/polkit/udev/udisks and friends have nothing to do with chowning the mounted partitions. The only way is to set the owner of partition/device when you format it ( i.e. mkfs.ext4 -E root_owner=uid:gid /dev/sdXn ).

This way, everytime you mount the partition, the system will assign ownership to the user specified by uid.

Last edited by pabloski (2014-10-19 14:26:12)

Offline

Board footer

Powered by FluxBB