# Mount exfat fuse as regular user



## wolfdreamer (Jun 28, 2014)

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


```
# sysctl vfs.usermount
vfs.usermount: 1
```


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


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


```
# cat /etc/rc.conf 
..
..
...
devfs_system_ruleset="localrules"
```


```
% 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

```
# mount.exfat /dev/da0s1 /media/usb
FUSE exfat 1.0.1
```


----------



## jayveesea (Jun 29, 2014)

*non-root access to mount*

I am trying to use `mount` as a non-root user, but I get the following...

```
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...

```
id john
uid=1001(john) gid=1001(john) groups=1001(john),0(wheel),5(operator)
```
and the permissions for `mount`...

```
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.


----------



## bsdkeith (Jun 29, 2014)

*Re: non-root access to mount*

You may just be lacking a filesystem type in your mount command. Perhaps try

```
mount -t msdosfs /dev/da0s1 ~/usb
```


----------



## jayveesea (Jun 29, 2014)

*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`


----------



## ondra_knezour (Jun 29, 2014)

*Re: non-root access to mount*

Do your user have the /sbin in the PATH environment variable? Did you try to use full path like `/sbin/mount ...`?


----------



## wblock@ (Jun 29, 2014)

*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.


----------



## jayveesea (Jun 30, 2014)

*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 
	
	



```
export PATH=$PATH:/sbin
```
 in ~/.profile, but that did not work for me.


----------



## jayveesea (Jul 3, 2014)

*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:

```
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?


----------



## SirDice (Jul 5, 2014)

*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).


----------

