1

I'm using Debian testing with XFCE as Desktop Environment and Thunar as filemanager. I've an issue regarding the mounting of USB mass storages such as USB flash drive. When I plug in the USB flash drive the icon representing it appears on the desktop; if I double-click it, Thunar mounts it but with root as user and group. Result: I can access the device (as user), but I cannot write on it.

I've checked mount output with two different USB flash drives. I've noticed that the automount is correctly done with the USB flash drive on which the filesystem is created on /dev/sdb (USB flash drive 1), for example; in the other one where I've a /dev/sdb1 partition (USB flash drive 2), XFCE automounting doesn't correctly work and mount the device with root ownership.

USB flash drive 1 mount output:

/dev/sdb on /media/gilberto/3C93-E461 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

USB flash drive 2 mount output:

/dev/sdb1 on /media/usb0 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro,user)

Any solution for this issue?

Giacomo1968
  • 58,727

2 Answers2

0

Should first check that the drive is being mounted correctly, no error messages or "read-only" type messages in dmesg or /var/log/syslog

Then you probably want to use some mount options like the ones below (from man mount):

Mount options for fat
(Note: fat is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems.)

uid=value and gid=value
Set the owner and group of all files. (Default: the uid and gid of the current process.)

umask=value
Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal.

And this might be informative, if the drive is initially writeable but then changes:

If the msdos filesystem detects an inconsistency, it reports an error and sets the file system read-only. The filesystem can be made writable again by remounting it.

Then when the right options are found, you can edit /etc/fstab or use Disks (gnome-disk-utility, though it's not been 100% reliable in the past).


I'm not sure why Thunar (or udisks2) is not mounting the drives properly... looks like the fmask / dmask codes show no user permissions, and/or no read permissions. I'm on Linux Mint XFCE and USB drives with fat "just work"... Adding an entry for each partition's UUID (from sudo blkid) to /etc/fstab should fix it, but shouldn't be necessary. Actually, is there anything strange in that file now?

Checking my Thunar Edit -> Preferences -> Advanced tab - Volume Management checkbox is checked, and when I click the Configure link it goes to the XFCE Settings -> "Removable Drives and Media" where there is nothing checked for any of the tabs (Storage -> Removable Storage, all are unchecked) except for "Play VCD's/DVDs".

Maybe there's a strange setting in there somewhere? Try changing things so they're similar to mine? And if it's not a setting there, maybe udisks/udisks2 is doing something strange on it's own, but I'm not sure how to change that... man udisks/man udisks2 would be the first stop.

Xen2050
  • 14,391
0

I encountered the same problem with my Debian desktop and the suggestion by Tara on Bodhi Linux Forums solved it.

Essentially I removed the line including the device /dev/sdb1 in my /etc/fstab and then Thunar started mounting any USB storage devices with my account instead of root. Detection of devices and mounting are taken care of by gvfs and thunar-volman.

Giacomo1968
  • 58,727