# Auto-mounting USB NTFS drives under FreeBSD 10.1



## AngryWolf (Jan 11, 2015)

Hi,

The following command works as *root*:

`ntfs-3g /dev/da0s1 /media/Data`

However, I would like to *auto-mount* this drive using HAL in my MATE desktop as a *regular user*. How can I make that work?

(UBS pendrives work fine, I can mount and unmount them just fine.)

If this helps, the following command fails as a regular user:


```
$ ntfs-3g /dev/da0s1 ~/Data
mount_fusefs: /dev/fuse on /usr/home/angrywolf/Data: Operation not permitted
fuse: failed to mount file system: No such file or directory
```


```
$ ls -l /dev/fuse*
crw-rw----  1 root  operator  0x32 Jan 11 16:59 /dev/fuse
$ groups angrywolf
angrywolf wheel operator vboxusers
```


Thanks in advance.


----------



## AngryWolf (Jan 11, 2015)

Well if there is no such solution yet, I can accept this one (written into /etc/fstab):


```
/dev/da0s1   /mnt/Data     ntfs     rw,mountprog=/usr/local/bin/ntfs-3g     0   0
```

The down-side of this approach is that if it's booted at system start up, like it is set now, and the USB hard drive happens to be not connected, the *system will refuse booting*, rather than silently falling back to not mounting the file system. Too bad.


----------



## tobik@ (Jan 11, 2015)

Add noauto or failok:


```
/dev/da0s1   /mnt/Data     ntfs     noauto,rw,mountprog=/usr/local/bin/ntfs-3g     0   0
```


----------



## AngryWolf (Jan 11, 2015)

Great, I'll go with failok, thank you!


----------



## junovitch@ (Jan 25, 2015)

Are you aware of `sysctl -d vfs.usermount`?

```
vfs.usermount: Unprivileged users may mount and unmount file systems
```

The caveat is the user has to own where they are mounting the drive to in order to keep them from maliciously mounting their own version of important files over the top of the system ones.


----------



## AngryWolf (Jan 25, 2015)

Hi junovitch,

Yes, I can assure you I had put the following line into sysctl.conf long before I attempted to try out USB storages on it (I had also set it on command line so I hadn't had to reboot):


```
vfs.usermount=1
```

Anyway, thanks for replying.


----------

