Mount exfat fuse as regular user

I am trying to figure out why I can't mount a USB drive as regular user (exFAT).

Code:
# sysctl vfs.usermount
vfs.usermount: 1

Code:
# cat /etc/devfs.conf
own	/dev/fuse	root:wheel
perm	smb0	        0660
perm	  da0	       0660

Code:
# cat /etc/devfs.rules 
[localrules=10]
add path 'da*s*' mode 0770 group wheel
add path 'usb/*' mode 0770 group wheel

Code:
# cat /etc/rc.conf 
..
..
...
devfs_system_ruleset="localrules"

Code:
% mount.exfat /dev/da0s1 /media/usb
FUSE exfat 1.0.1
mount_fusefs: /dev/fuse on /media/usb: Operation not permitted

This works as root
Code:
# mount.exfat /dev/da0s1 /media/usb
FUSE exfat 1.0.1
 
non-root access to mount

I am trying to use mount as a non-root user, but I get the following...
Code:
mount /dev/da0s1 ~/usb
mount: not found

I have added vfs.usermount=1 in /etc/sysctl.conf.

Also, when I check my groups I get...
Code:
id john
uid=1001(john) gid=1001(john) groups=1001(john),0(wheel),5(operator)
and the permissions for mount...
Code:
whereis mount
mount: /sbin/mount /usr/share/man/man8/mount.8.gz /usr/src/sbin/mount
ll /sbin/mount
-r-xr-xr-x  1 root  wheel  24520 Jan 16 17:40 /sbin/mount*
...so if the user john is in the wheel group and mount is executable by the wheel group where have I gone wrong? also, in thunar I can see the usb drive when I plug it in and have no problem accessing the contents.
 
Re: non-root access to mount

You may just be lacking a filesystem type in your mount command. Perhaps try
Code:
mount -t msdosfs /dev/da0s1 ~/usb
 
Re: non-root access to mount

Thanks @bsdkeith for the reply. The command... mount -t msdosfs /dev/da0s1 ~/usb ...works for root, but as non-root I get the same response... mount: not found
 
Last edited by a moderator:
Re: non-root access to mount

I'd guess that the mountpoint, ~/usb, is present in the root user's home directory but not in the other user's directory. The error message is saying that directory is not found, not the command.
 
Re: non-root access to mount

Thanks everyone! Using the full path worked. What is the best way to update the PATH permanently? I am using sh for my shell, so I was thinking I could put
Code:
export PATH=$PATH:/sbin
in ~/.profile, but that did not work for me.
 
Re: non-root access to mount

I am still struggling with my PATH variable. At the terminal I issue echo $SHELL and get /bin/sh. I thought the startup script for sh was ~/.profile, but when I view this file I can see that /sbin is already included in the PATH variable.

Here is the first entry in my .profile:
Code:
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH

So what is the correct startup script to use to update my PATH variable?
 
Re: non-root access to mount

jayveesea said:
At the terminal I issue echo $SHELL and get /bin/sh.
I would suggest setting your shell to tcsh(1). It's a lot better to use interactively, it has all sorts of command completions, file completions, history, etc. Use sh(1) only for scripting ((t)csh is notoriously bad for scripting).
 
Back
Top