# how to unmount ntfs-3g ?



## ahavatar (Sep 28, 2010)

Greetings,

I've installed fusefs-ntfs and changed some settings on my FreeBSD 8.1-RELEASE: 


```
# pkg_add -r fusefs-nfts
# sysctl -w vfs.usermount=1
# mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
# ln -s /usr/local/bin/ntfs-3g /sbin/mount_ntfs
```
added a line to /etc/rc.conf

```
fusefs_enable="YES"
```
and in gconf-editor, I deleted the -m option of ntfs since ntfs-3g has no such option.

On my Gnome 2.30.2, I can mount an NTFS partition by clicking Place->Removable Media->WIN DATA, where "WIN DATA" is the label of an NTFS partition.

So far so good, now if I want to unmount the partition, it failed with a "operation not permitted" message.

I'd appreciate any info or help to solve this problem. It would be great to mount/umount an NTFS partition like a Linux system with ntfs-3g.


----------



## Beastie (Sep 28, 2010)

I believe you must mess with /usr/local/etc/PolicyKit/PolicyKit.conf. Add something like

```
<match action="org.freedesktop.hal.storage.unmount-others">
  <match user="ahavatar">
    <return result="yes"/>
  </match>
</match>
```
right before *</config>*.

I am not sure if the *action* is the right one though, so anyone feel free to correct me.

By the way, *vfs.usermount=1* should go into /etc/sysctl.conf or it will be gone the next time you reboot the machine.


----------



## ahavatar (Sep 28, 2010)

Beastie said:
			
		

> I believe you must mess with /usr/local/etc/PolicyKit/PolicyKit.conf.



I suspect the default PolicyKit.conf is okay because I can mount and unmount an FAT32 partition on my FreeBSD 8.1/Gnome 3.20. 

After mounting an FAT32 and an NTFS partitions


```
$ mount
/dev/ad4s2a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad4s2e on /tmp (ufs, local, soft-updates)
/dev/ad4s2f on /usr (ufs, local, soft-updates)
/dev/ad4s2d on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)
/dev/ad4s9 on /media/FAT32 SHARE (msdosfs, local, nosuid)
/dev/fuse0 on /media/WIN DATA (fusefs, local, nosuid, synchronous)
```

I can unmount FAT32 partition by right-click'ing the harddisk icon on my Gnome desktop and selecting Unmount. But I can't do that for an NTFS partition mounted with ntfs-3g. 

However, I can manually unmount an NTFS partition as a root.

```
$ umount /dev/fuse0
umount: unmount of /media/WIN DATA failed: Operation not permitted
$ su
# umount /dev/fuse0
#
```

Is there something with the device name /dev/fuse0 that gets Gnome or HAL confused here? Any ideas?


----------



## Beastie (Sep 28, 2010)

Are you a member of the wheel group?


----------



## ahavatar (Sep 28, 2010)

Beastie said:
			
		

> Are you a member of the wheel group?



Yes, I am.


----------



## wblock@ (Sep 28, 2010)

ahavatar said:
			
		

> However, I can manually unmount an NTFS partition as a root.
> 
> ```
> $ umount /dev/fuse0
> ...



Don't unmount the device, unmount the mountpoint:
`# umount /media/WIN\ DATA`

Although that's probably something you shouldn't do, since the system (probably hal) mounted that device and might be surprised to find it missing.

Also: please don't use spaces in file names.  Dashes and underlines are free, and 87.36% less evil than spaces.


----------



## ahavatar (Sep 28, 2010)

wblock said:
			
		

> Don't unmount the device, unmount the mountpoint:
> `# umount /media/WIN\ DATA`
> 
> Although that's probably something you shouldn't do, since the system (probably hal) mounted that device and might be surprised to find it missing.
> ...




```
# umount /media/WIN\ DATA
umount: /media/WIN DATA: not a file system root directory
# umount /dev/fuse0
#
```

Unmounting the mountpoint doesn't work but the device name does.


----------



## cabriofahrer (May 31, 2013)

Have you ever found the solution to that? I have exactly the same problem nowadays.


----------

