Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntfs-3g 2014.2.15 doesn't remove folder in Volumes after unmount #119

Closed
linkit87 opened this issue Mar 1, 2014 · 95 comments

Comments

Projects
None yet
@linkit87
Copy link

commented Mar 1, 2014

I've upgraded to the new ntfs-3g 2014.2.15 version, but now when I unmount a drive I still have the folder in /Volumes

@hube

This comment has been minimized.

Copy link

commented Mar 4, 2014

+1 I've run into this issue recently as well

@mkc188

This comment has been minimized.

Copy link

commented Mar 10, 2014

I have the exact same problem as well

@justinkb

This comment has been minimized.

Copy link

commented Mar 21, 2014

Same here. As a result, on rebooting, drives will be mounted at "/Volumes/Name 1". Next boot, at "/Volumes/Name 2", etc. It's a problem.

Actually, when I roll back to ntfs-3g 2013.xx.xx, this also occurs, so it seems the problem is contained in osxfuse, instead of being related to your ntfs-3g update.

@paramburu

This comment has been minimized.

Copy link

commented Mar 24, 2014

+1.. Same here... Tried to pinpoint the issue but couldn't...

@bfleischer

This comment has been minimized.

Copy link
Member

commented Mar 31, 2014

Actually, when I roll back to ntfs-3g 2013.xx.xx, this also occurs, so it seems the problem is contained in osxfuse, instead of being related to your ntfs-3g update.

It works well using the loopback reference file systems. As a general rule osxfuse does not remove mount points after unmounting FUSE volumes. As far as I know /Volumes is managed by Mac OS X. I think you should raise this issue with the ntfs-3g team.

@muellermartin

This comment has been minimized.

Copy link

commented Apr 17, 2014

+1 Noticed this some time ago, but thought this was only an issue on my system, but apparently it isn't.
This issue is really annoying.

@justinkb

This comment has been minimized.

Copy link

commented Apr 23, 2014

Well, this is not gonna get fixed, given the response @bfleischer gave

Should be trivial to reproduce for any of its developers, yet none have even tried after more than 2 months

@bfleischer

This comment has been minimized.

Copy link
Member

commented Apr 23, 2014

So far I have not been able to reproduce the issue. I installed ntfs-3g 2014.2.15 (homebrew) and created a NTFS volume using mkntfs. When unmounting the volume the mount point (/Volumes/ntfs) is removed automatically.

@muellermartin

This comment has been minimized.

Copy link

commented Apr 24, 2014

@bfleischer That's strange. Which version of osxfuse are you using? Did you use a block or something like a loop device for testing? It would be nice if you could provide the steps you used, so I can check back.

I'm also using NTFS-3G 2014.2.15 with OSXFUSE 2.6.4 (both installed via homebrew) on Mac OS 10.9.2.

There is also a topic in the official support forums for NTFS-3G relating this issue.

@wizsilex

This comment has been minimized.

Copy link

commented Apr 24, 2014

+1 I also have this problem.
/Volumes
d--x--x--x+ 3 root admin 102 Apr 19 15:53 BOOTCAMP
d--x--x--x+ 3 root admin 102 Apr 11 14:16 BOOTCAMP 1
d--x--x--x+ 3 root admin 102 Apr 22 10:26 BOOTCAMP 2
d--x--x--x+ 3 root admin 102 Apr 22 10:26 BOOTCAMP 3
d--x--x--x+ 3 root admin 102 Apr 22 17:33 BOOTCAMP 4
d--x--x--x+ 3 root admin 102 Apr 22 17:34 BOOTCAMP 5
d--x--x--x+ 3 root admin 102 Apr 23 11:53 BOOTCAMP 6
drwxrwxrwx 1 1025 staff 8192 Apr 23 11:53 BOOTCAMP 7

ntfs-3g: stable 2014.2.15 (bottled)
osxfuse: stable 2.6.4 (bottled), HEAD
Homebrew 0.9.5
osx 10.9.2

@bfleischer

This comment has been minimized.

Copy link
Member

commented Apr 25, 2014

@muellermartin I installed ntfs-3g 2014.2.15 and osxfuse 2.6.4 via homebrew on OS X 10.9.2, like you did. Here is what I did to create and mount the volume:

Use file as volume

dd if=/dev/zero of=~/Desktop/test.ntfs bs=1048576 count=25     # 25 MB zero-filled file
/usr/local/sbin/mkntfs -F ~/Desktop/test.ntfs 
mkdir /Volumes/ntfs
/usr/local/bin/ntfs-3g ~/Desktop/test.ntfs /Volumes/ntfs -olocal

Use flash drive as volume

sudo /usr/local/sbin/mkntfs -F -f /dev/disk1s1    # Volume on flash drive
mkdir /Volumes/ntfs
sudo /usr/local/bin/ntfs-3g /dev/disk1s1 /Volumes/ntfs -olocal -oallow_other

Once I unmount the volume, directory /Volumes/ntfs is gone.

@paramburu

This comment has been minimized.

Copy link

commented Apr 25, 2014

@bfleischer The problem seems to be with Mac's Automounting capabilities. If you install ntfs-3g with Homebrew you need to replace /sbin/mount_ntfs with the one provided with ntfs-3g or change the PATH environment variable so the system finds ntfs-3g's mount_ntfs first.

Then, when you plug your flash drive it automounts and works fine but when you unmount (at least in my case vía Finder, not Command Line) instead of the folder being deleted, it changes it's owner to root and it's permissions and other flags so it's not really an empty directory (I can't remember specifically) but like a hard link to nowhere or something like that.

Then, each time you plug the flash drive it adds a postfix with the number of "pseudo"folders that remain in /Volumes folder.

At least that's in my case.

@muellermartin

This comment has been minimized.

Copy link

commented Apr 26, 2014

@bfleischer Thanks for providing the exact commands! Because when I try them on my machine, it also works both using dd or an existing drive (I tried my Bootcamp partition).

@paramburu I also checked my /sbin/mount_ntfs and mine is symlinked to /usr/local/sbin/mount_ntfs (which is symlinked to the one installed by ntfs-3g by Homebrew).

@LongLVNH

This comment has been minimized.

Copy link

commented Apr 30, 2014

Reverting back to 2013.1.13 didn't solve the issue for me, rather I was able to fix this up removing osxfuse and reverting back to [ the old & obsolete ] fuse4x as macports replaced fuse4x using the following argument "this port is only a stub and has been made obsolete by osxfuse" ( https://trac.macports.org/ticket/39456 ).

In my case, as I only use fuse for NTFS, I don't mind staying with obsolete software for a while.

Downloaded:
The official Fuse4X dmg from http://fuse4x.github.io/ ( https://github.com/downloads/fuse4x/fuse4x/Fuse4X-0.9.2.dmg )

The ntfs-3g sources version 2014.2.15 from http://www.tuxera.com/community/ntfs-3g-download/ ( http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2014.2.15.tgz )

Installed:
Fuse4X.pkg from Fuse4X-0.9.2.dmg
Extracted the sources from ntfs-3g_ntfsprogs-2014.2.15.tgz and executed the following commands:

      ./configure --exec-prefix=/usr/local --with-fuse=external
      make
      sudo make install

Mount script:
I have the following script for Mac OS X auto mounting ( /sbin/mount_ntfs ):

#!/bin/bash

VOLUME_NAME="${@:$#}"
VOLUME_NAME=${VOLUME_NAME#/Volumes/}
USER_ID=499
GROUP_ID=20

if [ `/usr/bin/stat -f %u /dev/console` -ne 0 ]; then
 USER_ID=`/usr/bin/stat -f %u /dev/console`
 GROUP_ID=`/usr/bin/stat -f %g /dev/console`
fi

/usr/local/bin/ntfs-3g \
 -o volname="${VOLUME_NAME}" \
 -o local \
 -o noappledouble \
 -o negative_vncache \
 -o auto_xattr \
 -o auto_cache \
 -o noatime \
 -o windows_names \
 -o user_xattr \
 -o inherit \
 -o uid=$USER_ID \
 -o gid=$GROUP_ID \
 -o allow_other \
 -o hide_dot_files \
 "$@" >> /var/log/mount-ntfs-3g.log 2>&1

exit $?;

As this is an obsolete setup, I will remain with this until the next major update of OSX as it has been 2 months already and the problem with osxfuse seems to be staying around for a while, maybe for the next major update of OSX it will be fixed and fuse4x does the job fine.

@lucascampelo

This comment has been minimized.

Copy link

commented May 1, 2014

+1.. Same here...

@lucascampelo

This comment has been minimized.

Copy link

commented May 1, 2014

I found a ntfs-3g dependence from fuse4x (dyld: Library not loaded: /usr/local/lib/libfuse.2.dyli).. try type "ntfs-3g" on terminal

@LongLVNH

This comment has been minimized.

Copy link

commented May 1, 2014

you can compile ntfs-3g (2013.1.13) for osxfuse, if you use macports you can execute the fetch, unpack, configure, build, destroot & install phases using the Portfile of the previous version.

@jgosmann

This comment has been minimized.

Copy link

commented May 1, 2014

+1 here

@jgosmann

This comment has been minimized.

Copy link

commented May 1, 2014

To extend on @paramburu's post: The permissions and ownership of the leftover folders is
d--x--x--x+ 3 root admin 102 24 Apr 00:11 BOOTCAMP
and they contain the following item:
d-wx-wx-wt@ 2 root admin 68 24 Apr 00:08 .Trashes

@jgosmann

This comment has been minimized.

Copy link

commented May 1, 2014

I know that it was working for me with fuse4x (which is marked as obsolete in Macports and replaced by osxfuse now). So I took a quick look and compared the source code of the osxfuse implementation of fuse_kern_unmount and the fuse4x implementation. I do not have any knowledge of the FUSE interna, so this might not even the right place to look. However, there is one difference which seems to me that it might be responsible for the problem (though it is a bit of a far shot). fuse4x closes the file descriptor prior to unmounting, whereas osxfuse does not seem to do that. Could that cause the problem?

I might try to get osxfuse compiled and try it out.

@ghost

This comment has been minimized.

Copy link

commented Jun 8, 2014

+1 for me

@scadete

This comment has been minimized.

Copy link

commented Jun 9, 2014

+1
It's not a solution but you can safely remove the folder after it gets unmounted. As it was said before, there will be a .Trashes file inside so you can use:

sudo rm -r /Volumes/DeviceName/

@kpykc

This comment has been minimized.

Copy link

commented Jun 11, 2014

+1
very annoying, especially if you store VirtualBox vdi images on external drive :), or use any other soft that expects that path to files isn't volatile.

@LongLVNH

This comment has been minimized.

Copy link

commented Jun 11, 2014

I wouldn't use the "sudo rm -r /Volumes/DeviceName/" command on a script and is annoying running it every time you unmount a volume.

I prefer going back to obsolete.

@justinkb

This comment has been minimized.

Copy link

commented Jun 12, 2014

Pretty irresponsible to suggest

$ sudo rm -r /Volumes/DeviceName/

If it's actually mounted when you do this... you might lose all your data. Methinks this is safer:

$ sudo rm -r /Volumes/DeviceName/.Trashes
$ sudo rmdir /Volumes/DeviceName

Worst case you lose the contents of the trash bin on that mounted folder and the rmdir fails without leaving you without all that data

@jisakiel

This comment has been minimized.

Copy link

commented Jun 12, 2014

Just a wild guess - I would bet the problem lies closer to fuse_mount_core , as the .Trash being created in the external folder seems to suggest that the OS is being notified of a new mount before the mount is really ready (around the mount: tag).

@netvl

This comment has been minimized.

Copy link

commented Jun 13, 2014

+1, same thing here. osxfuse 2.6.4, ntfs-3g 2014.2.15

@jgosmann

This comment has been minimized.

Copy link

commented Jun 16, 2014

@jisakiel You're thoughts seem to go in the right direction. I did some more analysis of the problem today and this is what I found out:

The fuse_mount_core calls the mount_osxfusefs program which does the final mount in line 938. This call is asynchronous and fuse_mount_core does not wait for it to finish. I assume that OS X assumes the mount to be complete after fuse_mount_core (and its calling functions) return. At this point the mount_osxfuse program might not be finished yet. Actually, when I add a sleep before the final mount call, I can observe that the mount point gets created with a .autodiskmountedfile (which is ok) and .Trashes in it before the contents get hidden by the volume being mounted.

Thus, I tried to eliminate this race condition by waiting for the child process and/or adding a long sleep after the fork for calling mount_osxfusefs. Unfortunately, that did not work and I am not sure why. In this case, however, the created mountpoints contains only the .autodiskmounted file until the mount process is completed (or at least until a short duration before this point).

@jgosmann

This comment has been minimized.

Copy link

commented Jun 16, 2014

Just noticed, that I (accidentally) wasn't waiting for the child process to finish. Actually waiting for it to finish seems to produce a deadlock. That is consistent with a long sleep not solving the problem.

@anacrolix

This comment has been minimized.

Copy link

commented Apr 27, 2015

This is very disappointing. It stinks like the Python 3 port. Maybe the plan is to pile enough features and bug fixes onto the next version (which I believe is some kind of major rewrite) that people will be forced to upgrade. Has anyone isolated the fix for this so that they can release a pkg with just that change?

@wodim

This comment has been minimized.

Copy link

commented Apr 27, 2015

@bfleischer dolan pls. My disk is called Windows and I'm already at "Windows 1488".

@benwilson

This comment has been minimized.

Copy link

commented Apr 29, 2015

Script to keep Volumes directory clean. Will fail to delete if it results in data loss.
Change rmdir to rm -rf at your own risk.

#!/bin/bash
#
# osxfuse-dirfix.sh 
#
# Iterate /Volumes/* and remove any directory that isn't in `mount`
# (ignores all symlinks, OSX creates one for root fs)
#
for f in /Volumes/*; do
    if [[ -d "$f" && ! -L "$f" ]]; then
        mount | grep "on $f" > /dev/null
        if [ $? -ne 0 ]; then
            rmdir "$f/.Spotlight-V100" &> /dev/null
            rmdir "$f/.Trashes" &> /dev/null
            rmdir "$f" &> /dev/null
        fi
    fi
done

I run it in root crontab every 5 minutes.

*/5 * * * * /path/to/osxfuse-dirfix.sh

It's an ugly bandaid, but if you have applications or scripts that depend on specific locations, it helps.

@muellermartin

This comment has been minimized.

Copy link

commented Jul 12, 2015

I've just installed the latest release (3.0.4) via the provided DMG installer and the issue seems to be resolved.

The extension is even signed by @bfleischer so there is no need for disabling the signature checks (nvram boot-args=kext-dev-mode=1). Sadly, I couldn't update the Homebrew Formula to provide an updated package, because I don't know how Homebrew handles the codesigning stuff and building it from source would require a valid certificate…

Anyway, thank you very much for finally fixing this! Is there are way to donate?

@dannyt66

This comment has been minimized.

Copy link

commented Aug 30, 2015

I've just noticed this issue on my MacBook Pro. OSXFuse Version 2.8 and NTFS-3G 2015.3.14 (built from home-brew as per the wiki). I have the lingering entries in /Volumes and also the mounted volumes don't appear in finder, I have to go into /Volumes to access them. OS X 10.11 Build 15A262e

@paaguti

This comment has been minimized.

Copy link

commented Sep 20, 2015

Same here with 10.10.5. Reinstalled with "brew cask" as per WIKI. Where is the 3.0.4 DMG installer? Someone working on upgrading the homebrew cask?

@paaguti

This comment has been minimized.

Copy link

commented Sep 24, 2015

Wasn't able to build OSXFUSE from github:
paag:osxfuse paag$ ./build.sh -t distribution
Falling back to OS X 10.11 SDK as default SDK
T:distribution | Clean target
T:distribution | Build target for OS X 10.11
T:fsbundle | Clean target
T:fsbundle | Build target for OS X 10.11
T:kext | Clean target
T:kext | Build target for OS X 10.11
T:kext | Install target
T:fsbundle | Install target
T:library | Clean target
T:library | Build target for OS X 10.11
T:library | Failed to configure target
Terminated: 15
Anyone can point me to an official 3.0.x distribution I can use?

@jamestwotree

This comment has been minimized.

Copy link

commented Sep 24, 2015

@paaguti You can find the 3.0.x releases at the OS X FUSE Github release page: https://github.com/osxfuse/osxfuse/releases

I can confirm that the 3.0.6 release fixes this issue for me. Installing the .DMG is the fastest fix until the new release is updated in Homebrew

@capthy

This comment has been minimized.

Copy link

commented Sep 30, 2015

@jamestwotree this works for me

@paaguti

This comment has been minimized.

Copy link

commented Sep 30, 2015

I'm using OSXFuse 3.0.3 and it seems to work on Yosemite
El 30/09/2015 05:23, "capthy" notifications@github.com escribió:

jamestwotree this works for me


Reply to this email directly or view it on GitHub
#119 (comment).

@stechico

This comment has been minimized.

Copy link

commented Oct 16, 2015

OSXFuse 3.0.6 on 10.11. Not working.

@paaguti

This comment has been minimized.

Copy link

commented Oct 17, 2015

Good to know. I'll stay Yosemite for some time I guess
El 16/10/2015 12:35, "Sherwin Techico" notifications@github.com escribió:

OSXFuse 3.0.6 on 10.11. Not working.


Reply to this email directly or view it on GitHub
#119 (comment).

@jamestwotree

This comment has been minimized.

Copy link

commented Oct 17, 2015

OSXFuse 3.0.6 works just fine for me on 10.11

@stechico

This comment has been minimized.

Copy link

commented Oct 17, 2015

Hmm... I did the DMG install of OSXFuse. Did you use the brew version install of it? @jamestwotree

@jamestwotree

This comment has been minimized.

Copy link

commented Oct 17, 2015

@stechico I used the DMG install. Did you make sure to safely eject your external hard drive first, delete all mounts, reboot, then reconnect it?

@stechico

This comment has been minimized.

Copy link

commented Oct 17, 2015

@jamestwotree Can you quickly run me through those steps please

On Saturday, October 17, 2015, jamestwotree notifications@github.com
wrote:

@stechico https://github.com/stechico Yep I used the DMG install. Did
you make sure to safely eject your external hard drive first, delete all
mounts, reboot, then reconnect it?


Reply to this email directly or view it on GitHub
#119 (comment).

Sent from Mobile--please excuse terseness and typos.

@stechico

This comment has been minimized.

Copy link

commented Oct 17, 2015

This seems to have helped me, https://support.apple.com/en-us/HT203258

Thanks

@jamestwotree

This comment has been minimized.

Copy link

commented Oct 17, 2015

@stechico Yep that's the same guide I followed. Glad it worked.

@viniciusuriel

This comment has been minimized.

Copy link

commented Nov 1, 2015

+1 Version 3.0.4 works correctly with ntfs-3g regards the folder names and additionally the volume icon now appears in finder too.

@saaqibz

This comment has been minimized.

Copy link

commented Dec 20, 2015

Thanks +1 that upgrading from stable to version 3.0.9 fixed this problem for me on Yosemite.

@bfleischer bfleischer self-assigned this Feb 14, 2016

@bfleischer bfleischer added this to the 3.2.0 milestone Feb 14, 2016

@bfleischer bfleischer added the feature label Feb 14, 2016

@bfleischer

This comment has been minimized.

Copy link
Member

commented Feb 14, 2016

osxfuse 3.2.0 has been released, so I'm closing this ticket.

@bfleischer bfleischer closed this Feb 14, 2016

@ptoche

This comment has been minimized.

Copy link

commented Mar 11, 2016

Why is 2.8.3 listed as a 'stable' release when it's clearly not quite so?

https://osxfuse.github.io/

@elmosgot

This comment has been minimized.

Copy link

commented Aug 1, 2016

The solution for me was to install the beta version:

  1. Go to 'System preferences'
  2. Click on 'FUSE for macOS'
  3. Select the option 'Show beta versions'
  4. Click 'check for updates'
  5. Install the update
  6. Unmount drive/partition
  7. Remove /Volume duplicate folders
  8. Mount drive and all works fine also with permissions
@sir-brickalot

This comment has been minimized.

Copy link

commented Aug 1, 2016

I didn't see this issue with latest versions at all.

@wodim

This comment has been minimized.

Copy link

commented Aug 1, 2016

This still happens with 2.8.3, which is what's marked as "stable". You could update that part of the website so the Homebrew Cask developers can catch up with the bug fixed version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.