I'm trying to mount a Windows ntfs partition on openSuse 11.4. When I mount it using the root account (either directly or via sudo) it mounts without problems. But when I try mounting it without any root privileges, it gives me the following error:
Error opening '/dev/sda2': Permission denied Failed to mount '/dev/sda2': Permission denied Please check '/dev/sda2' and the ntfs-3g binary permissions, and the mounting user ID. More explanation is provided at http://ntfs-3g.org/support.html#unprivileged
My fstab entry for the concerned device is:
/dev/sda2 /media/Windows ntfs defaults,noauto,user 1 2
I've searched Google for possible solutions, but I don't seem to be getting anywhere.
As suggested, I tried to set the UID/GID bits on the ntfs-3g binary. All the files (/sbin/mount.ntfs, /sbin/mount.ntfs-3g) point to /usr/bin/ntfs-3g, so I changed the permissions on that. The permissions now are:
-rwsr-sr-x 1 root root 51512 Feb 18 22:18 ntfs-3g
But the result is still the same and I get the same permission denied error.
After setting the correct permissions on all the files:
-rwsr-xr-x 1 root root 51512 Feb 18 22:18 ntfs-3g brw-rw-rw- 1 root disk 8, 2 Aug 6 21:53 sda2 drwxrwxrwx 1 asad users 8192 Jul 30 13:09 Windows
I was able to mount with out a privileged user account. However, now when I try to unmount using the same account, I get:
asad@jb-laptop:~> umount /dev/sda2 umount: only root can unmount /dev/sda2 from /media/Windows
I finally found the problem. I needed to add users instead of user in fstab for some reason, although I can't understand why. Now I have a new problem :)
Whenever I unmount the device /dev/sda2, somehow the file permission ends up going back to default (0660). I tried to create a rule in udev but it doesn't seem to be working.