10

On Debian there is the common problem, that you try to plug an ntfs formatted USB harddrive and then can't write to it as a regular user to it because the directory belongs to root.

A little time ago I read that that can be fixed with adding the uid=1000,gid=1000 (or whatever your uid and gid are) options. This does solve the problem but seems a little bit nasty to me, because if you have a multiuser system the drive always belongs to the same user and not to the user who mounted it/is logged in.

From my time with Ubuntu I remember that this wasn't a problem and you could mount NTFS drives (with GNOME) and they were writable by the user who mounted them. So it seems that GNOME is able to mount the drive with permissions given to the logged in user.

However now I'm using KDE on Debian jessie and I'm wondering if I can configure my computer to mount the drives with the permissions of the user who has the active X-session.

  • 1
    Hmmm... but the one line brief at man fstab tells: fstab - static information about the filesystems D: – 41754 Jan 30 '14 at 15:39
  • I'm not sure of the answer, but my limited knowledge says it probably has something to do with udev. – ND Geek Feb 13 '14 at 19:31
  • @NDGeek, udev deals with device naming, not device mounting. – jayhendren Feb 20 '14 at 22:22
  • @jayhendren good to know. After poking at this on my own system, would udisks be a more likely culprit? Again, this is an area I haven't had much experience with, so I'm tinkering trying to figure some of this out. – ND Geek Feb 21 '14 at 18:29
3

It does seem like you have modified your fstab to mount this device manually .. Or perhaps you have made entries in autofs? .. Debian/ubuntu has moved along from requiring manually configured mounts for a long time now, even for non-GUI environments.

Generally, you would not need to do manual mounts, and all the various desktop environments handle this seamlessly and often in slightly different ways (as long as the device is not setup in fstab).

Some would use udev/pmount, with consolekit/policykit helping with auth. First thing to do is to remove the manual mount settings you have and reboot. I am sure that alone will fix your automounting challenges. Why don't you try that first, and then report back if you still have challenges

Also, if you have been tinkering with the permissions of the ntfs-3g or lowntfs-3g binaries, try to revert them back to their default ownerships and permissions. In short, revert back to default settings and reboot, and you should be fine.

The solution Kiwy is suggesting (and others) would only become necessary when you have further issues after reverting to default settings..

  • Thanks, that worked. I'm sure that I have never placed them in the fstab. But now it works. – Kritzefitz Apr 27 '14 at 9:37
1

One solution I find for this problem is to use udev.
Edit /etc/udev/rules.d/99-automount.rules with your favorite editor and add those lines:

# --sync to allow removal without corruption 
# exclude sda since its the rootfs 
ACTION=="add",KERNEL=="sd[bcd]*", RUN+="/usr/bin/pmount --sync --noatime --umask 000 %k" 
ACTION=="remove", KERNEL=="sd[bcd]*", RUN+="/usr/bin/pumount %k" 

if you have more than one hard drive you might want to change sd[bcd] to sd[cde] or more as it will match the device name /dev/sd[c or d or e] and those letters are attributed with the number of disk you plug /dev/sda being the disk of the rootfs most of the time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.