Closing.
]]>chown -R root:disk /media/EXTDRIVE
]]>Use chown to try.
]]>UUID=a9be3383-ea83-45a1-a5ee-f0b8d7d6c666 /media/EXTDRIVE ext4 noauto,rw,user,exec 0 0
and created a mountpoint:
$ ls /media/ -l
total 16
drwxr-xr-x 2 root root 4096 4 dic 20.39 cd
drwxrwxr-x 2 root disk 4096 26 mar 11.02 EXTDRIVE
with write permissions for the disk group (to which my user belongs). When I mount my drive with dolphin (which relies on udisks2) I get this:
$ ls /media/ -l
total 16
drwxr-xr-x 2 root root 4096 4 dic 20.39 cd
drwxr-xr-x 3 root root 4096 24 mar 17.15 EXTDRIVE
The mountpoint ownership is now root:root instead of root:disk, so my user can't write on the HDD!! This is the intended behavior of udisks2, at least according to the udisks2 reference:
If the device in question is referenced in the /etc/fstab file, the mount command is called directly (as root) and the given options or filesystem type given in options are ignored. The authorization checks mentioned above are still performed.
So the filesystem is mounted as root:root and I'm back to the beginning...
@lucke: I understand. I'd like at least to be able to plug the drive on my pc, mount with Dolphin and write my backup on it. I hope I don't have to switch to NTFS to do such a simple thing...
]]>whobanil wrote:I'd like to point out something. If you use FAT32 instead of ext4 for cross-platform usability, FAT doesn't support permissions at all. Which will result in super user access only. I had this issue with a flashdrive. To fix this, make an entry in your fstab to mount the device and include the mount options rw,umask=000. This will allow normal users to access it.
If you want to use a different FS and still having permission issues, try fstab entry with mount options rw,user
Thanks, I never had problems with USB flash drives with FAT32: I can plug them and they are mounted so that I can write on them as a regular user, not root. I'll try the fstab entry and report the results!
OH, I just remember that I had this issue because I manually mounted it with fstab in the first place without the umask option. So it mounted to the specified dir without user write permissions. With nothing written to fstab, it does mount correctly haha.
]]>Microsoft filesystems don't use Linux permissions and thus they are decided at mount time. You connect a drive with NTFS/FAT, udisks mounts it so that files on it are owned by your user, thus you can do anything with them.
Yeah, problematic. I'd use NTFS if i wanted to have a (big) drive for dragging around.
]]>I'd like to point out something. If you use FAT32 instead of ext4 for cross-platform usability, FAT doesn't support permissions at all. Which will result in super user access only. I had this issue with a flashdrive. To fix this, make an entry in your fstab to mount the device and include the mount options rw,umask=000. This will allow normal users to access it.
If you want to use a different FS and still having permission issues, try fstab entry with mount options rw,user
Thanks, I never had problems with USB flash drives with FAT32: I can plug them and they are mounted so that I can write on them as a regular user, not root. I'll try the fstab entry and report the results!
]]>If you want to use a different FS and still having permission issues, try fstab entry with mount options rw,user,nofail
Here is the entry for my exfat flashdrive
#Flashdrive
UUID=DEDC-7FB9 /run/media/(my name)/Flashdrive exfat rw,defaults,umask=000,nofail,discard 0 0
NOTE: FAT32 supports file sizes < 4GB. That's why I use exfat
]]>USB sticks usually use FAT - it's possible to mount Microsoft filesystems (FAT and NTFS) so that files on them belong to any user.
If your drive is using a Linux filesystem, you can "chown -R mori.users /run/media/mori/". Then you might have problems accessing it on other computers.
I don't even have a /run/media folder before plugging the drive in... which BTW has an ext4 filesystem. Am I supposed to chown the mount folder every time I plug my drive after a reboot? This doesn't sound very user-friendly, not even power-user-friendly. Then I will be unable to use the drive with another pc (unless on that pc there is a group with my same gid which have write permissions on mounted drives, I guess), which is not so smart for an external drive...
Talking seriously, is this the way the Linux desktop is supposed to dominate the world? Is switching to a MS filesystem the only way to have a drive which I can plug in and write on on every pc with a USB port? Is there a modern, Linux-native filesystem tuned for external storage which solve these problems? Maybe everything boils down to ext4 not being tailored for USB disks...
If your drive is using a Linux filesystem, you can "chown -R mori.users /run/media/mori/". Then you might have problems accessing it on other computers.
]]>$ ll /run/media/mori/
total 4,0K
drwxr-xr-x 3 root root 4,0K 24 mar 17.15 EXTDRIVE
It seems that some udisks policy has to be set. I'm not an udisks expert, so I followed this https://wiki.archlinux.org/index.php/Po … USB_drives but it doesn't work (is this maybe systemd-related?). I can't figure out what to do to be able to mount the drive with write permission for my user in a safe and proper way. With USB sticks my system has no problem:
$ ll /run/media/mori/
total 4,0K
drwx------ 3 mori wizard 4,0K 1 gen 1970 222F-DB43
so maybe the HDD in the external enclosure is recognized as a different device than a USB flash memory stick? Here's the log on journalctl when plugging the external HDD:
mar 25 18:30:55 elric kernel: usb 8-1: new high-speed USB device number 18 using ehci-pci
mar 25 18:30:55 elric kernel: scsi13 : usb-storage 8-1:1.0
mar 25 18:30:55 elric laptop-mode[12442]: Laptop mode
mar 25 18:30:55 elric laptop-mode[12444]: enabled, not active
mar 25 18:30:56 elric laptop-mode[12460]: Laptop mode
mar 25 18:30:56 elric laptop-mode[12461]: enabled, not active
mar 25 18:30:56 elric kernel: scsi 13:0:0:0: Direct-Access TOSHIBA MK3252GSX PQ: 0 ANSI: 2 CCS
mar 25 18:30:57 elric kernel: sd 13:0:0:0: [sdb] 625142448 512-byte logical blocks: (320 GB/298 GiB)
mar 25 18:30:57 elric kernel: sd 13:0:0:0: [sdb] Write Protect is off
mar 25 18:30:57 elric kernel: sd 13:0:0:0: [sdb] Mode Sense: 34 00 00 00
mar 25 18:30:57 elric kernel: sd 13:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
mar 25 18:30:57 elric kernel: sdb: sdb1
mar 25 18:30:57 elric kernel: sd 13:0:0:0: [sdb] Attached SCSI disk
Thanks to everybody in advance.
]]>