LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting NTFS with ntfs-3g and fuse as a user? (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-ntfs-with-ntfs-3g-and-fuse-as-a-user-855044/)

masmddr 01-08-2011 02:10 PM

Mounting NTFS with ntfs-3g and fuse as a user?
 
Hello.
On a clean install of Arch linux I edited fstab to be like so :
Code:

/dev/disk/by-id/usb-Hitachi_HTS543232L9A300_9002555dd84a21024b000000-0:0-part1 /media/EXT  ntfs-3g  user,rw,uid=mas,gid=users,noauto  0 0
I tried ntfs and ntfs-3g but the result is the same
I can mount root but I would like to be able to mount as a user.
When I try to mount as a user I get
Code:

Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at
http://ntfs-3g.org/support.html#unprivileged

Before installing ntfs-3g I was able to mount as a user but there was no rw permission.
Any way to mount an ntfs partition as a user without suid as the message said?

EDDY1 01-08-2011 03:05 PM

You think chmod will help you?

masmddr 01-08-2011 04:21 PM

I don't see how...
I can't mount the device, though other devices with the same options in fstab (also mount under /media/) can be mounted and accessed with a regular user.
My problem is with ntfs devices.

trist007 01-08-2011 04:42 PM

You don't have sufficient privileges to mount those ntfs devices. Create a group. Add your user to the group. Then give the devices group permissions. That should work.

masmddr 01-08-2011 04:57 PM

Changing the group on /dev/sdb and /dev/sdb1 ( I couldn't change the group in /dev/disk/by-id/) and chmod a+rwx just in case didn't change anything.

Quote:

[root@masARCH mas]# ls -l /dev/sdb
brwxrwxrwx 1 root storage 8, 16 Jan 9 00:50 /dev/sdb
[root@masARCH mas]# ls -l /dev/sdb1
brwxrwxrwx 1 root storage 8, 17 Jan 9 00:50 /dev/sdb1
changed fstab to point to /dev/sdb1 and still nothing.

I'm probably doing it wrong aren't I ? :P

X.Cyclop 01-08-2011 05:10 PM

Did you try adding umask=000 ?

masmddr 01-08-2011 05:16 PM

Wouldn't that just give me rwx permissions?
I tried adding it now and still no go.

I have rw permissions on the drive as a user even if I mount it as root, I just can't mount ntfs with a user, other file systems can be mounted as a user.

John VV 01-08-2011 11:47 PM

you have been fallowing the arch wiki ?
https://wiki.archlinux.org/index.php/NTFS-3G
it works

and HOW are you starting system daemons ?(rc.conf ) and is HAL used ?
and see hal ntfs page
https://wiki.archlinux.org/index.php...S_write_access

alan99 01-09-2011 12:14 AM

Users can be given the right to mount ntfs-3g. Check and make have the fuse module loaded, that might help. Also the file /usr/bin/ntfs-3g must have the set-uid bit set so that you can use the mount function without actually switching to be the root user. Also, you should have permission to the mount point -- You could make the group permission of the mount point a member of users group and your users that you want to mount the drive to be members of user group. I tried these things and now I can mount my ntfs partition as a non-root user.

masmddr 01-09-2011 06:18 AM

I have been following the arch wiki.
I tried to do this without HAL but now I added HAL as the wiki said but still no mounting as user.
DAEMONS in rc.conf:
Quote:

DAEMONS=(syslog-ng acpid dbus hal cpufreq !network netfs crond ufw wicd)
The user is in the storage,optical,HAL groups.

Now a question, Everyone seems to direct me to how to get rw permissions on the mounted ntfs partition, I can't mount it to begin with.
If I mount it with root then everything is fine and I even have rw permissions as a normal user, I just can't mount it as a normal user :

Quote:

[mas ~]$ mount /dev/disk/by-id/usb-Hitachi_HTS543232L9A300_9002555dd84a21024b000000-0:0-part1
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at
http://ntfs-3g.org/support.html#unprivileged
fstab should allow me to have rw permissions as a normal user:
Quote:

/dev/disk/by-id/usb-Hitachi_HTS543232L9A300_9002555dd84a21024b000000-0:0-part1 /media/EXT ntfs user,rw,uid=mas,gid=users,noauto 0 0
I can however mount other filesystems with a normal user with the same setup in fstab.
Also I should have mentioned earlier that I am not using any file manager rather I am doing this in a terminal.

alan99:
I tried setting /bin/ntfs-3g (/usr/bin/ntfs-3g doesn't exist) as set-uid and now as a normal user I get :

Quote:

Mount is denied because setuid and setgid root ntfs-3g is insecure with the
external FUSE library. Either remove the setuid/setgid bit from the binary
or rebuild NTFS-3G with integrated FUSE support and make it setuid root.
Please see more information at http://ntfs-3g.org/support.html#unprivileged
I don't know how to rebuild NTFS-3G with integrated FUSE support since I am installing it from the package manager pacman, it installed fuse as a dependency for NTFS-3G.

networking.dept 01-09-2011 12:06 PM

@masmddr, Please try following things

Check it by editing your /etc/fstab entry like below

<device> <local-mount> ntfs-3g defaults 0 0
or
<device> <local-mount> ntfs defaults 0 0
or
/sbin/mount.ntfs-3g /device-partition <mount-point>

or you can mount your ntfs on local folder lets say /mnt and then just give a recursive permission using chmod should work. Try and let us know its working or not. You can also try with sudo.

masmddr 01-09-2011 01:02 PM

<device> <local-mount> ntfs-3g defaults 0 0
and
<device> <local-mount> ntfs defaults 0 0
Didn't change much since defaults mean a user can't mount the device, but adding "user" to it didn't help either.
Invoking mount.ntfs-3g directly gave me the same error about being unprivileged.
So I gave up and used sudo. I was trying to keep it as simple as possible but it seems in this case sudo is simpler.

Thank you all for your time and patience.


All times are GMT -5. The time now is 03:45 PM.