#27649 closed enhancement (fixed)
ntfs-3g: show mount in finder
Reported by: | markus.doits@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | pokui@…, drkp (Dan Ports), neverpanic (Clemens Lang), pixilla (Bradley Giesbrecht), ozaktash@…, khepler | |
Port: | ntfs-3g |
Description
i just got ntfs-3g to automount my volumes by replacing "/sbin/mount_ntfs" by "ntfs-3g"
mv /sbin/mount_ntfs /sbin/mount_ntfs.orig ln -s /opt/local/bin/ntfs-3g /sbin/mount_ntfs
this makes ntfs-3g automount my ntfs-volumes. but they don't show up in finder.
since there is the ntfs-3g-version for mac from tuxera (http://www.tuxera.com), where the volumes show up in finder, i searched in their code a little bit and found this in "ntfs-3g.c":
#if defined(__APPLE__) || defined(__DARWIN__) /* If the volume has a volume name, then append the MacFUSE-specific * 'volname' option, making the volume name appear in Finder. */ if (ctx->vol->vol_name) { int i; size_t vol_name_len = strlen(ctx->vol->vol_name); char *scrubbed_vol_name = calloc(1, sizeof(char) * (vol_name_len + 1)); if (scrubbed_vol_name == NULL) goto err_out; /* Scrub all ',' characters from the volume name since they * would interfere with FUSE argument delimiters. */ for (i = 0; i < vol_name_len; ++i) { char cur = ctx->vol->vol_name[i]; if(cur == ',') scrubbed_vol_name[i] = '_'; else scrubbed_vol_name[i] = cur; } scrubbed_vol_name[i] = '\0'; if (strappend(&parsed_options, ",volname=")) goto err_out; if (strappend(&parsed_options, scrubbed_vol_name)) goto err_out; free(scrubbed_vol_name); } #endif /* defined(__APPLE__) || defined(__DARWIN__) */
maybe this could be adapted by/added to the ntfs-3g macports version so the volumes show up in finder?
don't know whether they use a special macfuse or the "volname"-option is standard.
for reference, the latest source of tuxera ntfs-3g for mac can be found here: http://sourceforge.net/projects/catacombae/files/NTFS-3G%20for%20Mac%20OS%20X/2010.10.2/:
(so there's an updated version of ntfs-3g out, too: 2010.10.2. will open another ticket for update)
Attachments (6)
Change History (47)
comment:1 Changed 14 years ago by mf2k (Frank Schima)
Cc: | macsforever2000@… added |
---|---|
Owner: | changed from macports-tickets@… to petri@… |
Port: | ntfs-3g added |
Version: | 1.9.2 |
comment:2 Changed 14 years ago by mf2k (Frank Schima)
comment:3 Changed 14 years ago by markus.doits@…
here's an untested patch (compiled fine, but no ntfs-volume here to test it). I will report back in some hours after a test mount, but it looks good and should work.
Changed 14 years ago by markus.doits@…
Attachment: | Portfile.diff added |
---|
comment:4 Changed 14 years ago by markus.doits@…
unfortunately it seems not be easy like this. it mounts but still doesn't show up in finder. maybe someone has an idea why?
comment:5 Changed 14 years ago by markus.doits@…
i just compiled the full ntfs-mac package (the one tuxera uses and the above patch is from) with the macfuse 2.0.3 of macports, and mounting directly with the newly compiled "./ntfs-3g /dev/volume /Volumes/name" (with all their patches) shows no result in finder, either.
so looks like the problem lies elsewhere (maybe macports macfuse)? or is the mounting by "ntfs-3g" directly wrong?
at least macfuse says it supports a user space volname option, https://code.google.com/p/macfuse/wiki/OPTIONS
i'm clueless for now.
comment:6 follow-ups: 12 13 Changed 14 years ago by markus.doits@…
alright, i got it to work. there were different things.
- the patch above is working: the volname-option is successfully appended to the mount options.
- you have to use "-o local,auto_xattr" in addition to the patch to show the volume in finder
- because of auto_xattr, i think the extended attributes of ntfs-3g should be disabled by "-o streams_interface=none" (which is obviously a drawback if you need them).
See https://code.google.com/p/macfuse/issues/detail?id=370 that directed me to the solution (and also why i think "streams_interface=none" should be used - but i have to little knowledge of ntfs(-3g) and macfuse if it is really necessary)
I'm now using a special "mount_ntfs"-shell-script with the provided volname-patch - and my ntfs-automounts show up in finder.
Anyone with some knowledge about filesystems/ntfs-3g/macfuse can say something this approach? Is "streams_interface=none" really needed?
I could think of this solution provided as port-variants of ntfs-3g ("+auto_mount=enables auto_mount by ntfs-3g", "+show_in_finder=shows mounts in finder BUT disables ntfs xattr")
comment:7 Changed 14 years ago by markus.doits@…
finally, below is another fully working attempt.
- ntfs-3g does not need to be patched
- it's all done by a shell script
before going into details, first let me say that the "auto_xattr"-option is even used by the mount-script from tuxera in macntfs-3g, so should be safe.
the patch to the portfile does the following:
- copy a mount_ntfs-shell-script to ${prefix}/sbin/mount_ntfs and chmod 755
- add a variant display what to do after installation if you want the automount to happen
the files/mount_ntfs mounts ntfs-volumes correctly to display them in the finder, see the comments inside
there's no error checking nor displaying when something goes wrong, but that could be implemented if needed.
any comments?
Changed 14 years ago by markus.doits@…
Attachment: | auto_mount.diff added |
---|
small fix for hardcoded prefix
Changed 14 years ago by markus.doits@…
Attachment: | mount_ntfs.2 added |
---|
to place in /files/mount_ntfs and to use with auto_mount.diff
Changed 14 years ago by markus.doits@…
Attachment: | mount_ntfs.2.2 added |
---|
small fix for hardcoded prefix and typo
comment:8 Changed 14 years ago by markus.doits@…
this is getting messy... no way to delete attachments?!
so the files to use for my last attempts are:
- https://trac.macports.org/attachment/ticket/27649/auto_mount.diff to patch the Portfile
- https://trac.macports.org/attachment/ticket/27649/mount_ntfs.2.2 to place to files/mount_ntfs
comment:10 Changed 14 years ago by markus.doits@…
any progress on reviewing here? hadn't have any issues using my patch for the last days (occasionally accessing ntfs-usb-sticks). any other successful tester?
comment:11 Changed 14 years ago by petri@…
Will be taking a look after the worst part of the holidays have passed by. Not that I can guarantee a perfect answer. :) But still, I and openmaintainer are maintainers.
comment:12 Changed 14 years ago by petri@…
Replying to markus.doits@…:
- you have to use "-o local,auto_xattr" in addition to the patch to show the volume in finder
The patch file seems to be fine; however, I don't think we should automatically set local as per question 4.1 in the MacFUSE FAQ. Doing so would cause creation of various OS X-specific directories, for instance, just because you mounted the volume. This might not what most people want, no? There is however a suggestion to make the Finder show networked volumes, perhaps this should be notified to the user during install.
comment:13 follow-up: 14 Changed 14 years ago by petri@…
Replying to markus.doits@…:
- because of auto_xattr, i think the extended attributes of ntfs-3g should be disabled by "-o streams_interface=none" (which is obviously a drawback if you need them).
Actually, Tuxera's documentation regarding EAs suggests that if you use auto_xattr, then you could expose streams through streams_interface=openxattr. The docs seem to suggest that unless that is used, auto_xattr would not work as expected. I am wondering whether EAs are useable for most people though, I'm not used to working with them nor alternate streams. Any thoughts?
comment:14 follow-up: 15 Changed 14 years ago by markus.doits@…
Replying to petri@…:
The patch file seems to be fine; however, I don't think we should automatically set local as per question 4.1 in the MacFUSE FAQ. Doing so would cause creation of various OS X-specific directories, for instance, just because you mounted the volume. This might not what most people want, no? There is however a suggestion to make the Finder show networked volumes, perhaps this should be notified to the user during install.
I see, local is no option then. Unfortunately as per macfuse faq 4.3, there is no way to show up the volume in finder's sidebar then. But at least it can be shown on the desktop as a remote drive, which is better than nothing.
Replying to petri@…:
Actually, Tuxera's documentation regarding EAs suggests that if you use auto_xattr, then you could expose streams through streams_interface=openxattr. The docs seem to suggest that unless that is used, auto_xattr would not work as expected. I am wondering whether EAs are useable for most people though, I'm not used to working with them nor alternate streams. Any thoughts?
So you (or Tuxera) suggest(s) adding streams_interface=openxattr to the mount options? If so, let's do it. Since I haven't dealt with ntfs streams yet, I cannot say anything about them.
So to summarize: remove local, add streams_interface=openxattr are the changes to be made to the existing patch. Then we get a mount where streams should work(?) and the volume shows up as a network device on the desktop (if enabled as a preference in finder).
comment:15 Changed 14 years ago by petri@…
Replying to markus.doits@…:
So you (or Tuxera) suggest(s) adding streams_interface=openxattr to the mount options? If so, let's do it. Since I haven't dealt with ntfs streams yet, I cannot say anything about them.
I'm not suggesting it, rather I interpreted Tuxera's docs to be suggestive of that. However, I don't think it would do any harm, which is why I'd consider it.
So to summarize: remove local, add streams_interface=openxattr are the changes to be made to the existing patch. Then we get a mount where streams should work(?) and the volume shows up as a network device on the desktop (if enabled as a preference in finder).
Yes, but still, this is going outside of DESTROOT and I'm unsure how to nicely handle that (actually, I think MacPorts shouldn't in general meddle with OSX-installed files, but to implement this variant we'd have to). I'll have to look that up, and perhaps do some asking around.
comment:16 Changed 14 years ago by petri@…
Oh, and they have just released a new version of ntfs-3g, 2011.1.15 (see #28102).
comment:17 follow-up: 18 Changed 14 years ago by markus.doits@…
i just found https://groups.google.com/group/macfuse/browse_thread/thread/075261ef25ecf7ae - there is a apple script about adding the volume to the sidebar. This could be called by the shell script automatically after mounting the volume. Unfortunately I cannot get the applescript to work, because I get many syntax errors in my applescript editor (didn't do anything with applescript yet) and I don't know what is wrong.
And about the DESTROOT: Thats why the variant is actually only a comment for the user what to do after installation. Macports does not automatically do something out of DESTROOT (it can't by design, I think). So I do not see an easier solution, but maybe you can think of one.
comment:18 Changed 14 years ago by mf2k (Frank Schima)
Replying to markus.doits@…:
And about the DESTROOT: Thats why the variant is actually only a comment for the user what to do after installation. Macports does not automatically do something out of DESTROOT (it can't by design, I think). So I do not see an easier solution, but maybe you can think of one.
It is allowed but to be avoided if possible. The macfuse port does it though for example. You should add this to the portfile:
destroot.violate_mtree yes
In fact, the ntfs-3g portfile has that line commented out.
comment:19 Changed 14 years ago by mf2k (Frank Schima)
@ petri: I've updated the ntfs-3g portfile to the latest version. Let me know what you want done here, preferably with an updated portfile patch, and I will be happy to commit it. I don't see making changes outside of DESTROOT being a dealbreaker for a port such as this.
comment:20 Changed 14 years ago by markus.doits@…
it isn't only placing a file outside DESTROOT but replacing one belonging to the base mac os system.
Is there a portfile command that can do something like "back up a file outside DESTROOT and move it out of the way" on port activation and "put the backup back to it's place" on port deactivation (the file would be /sbin/mount_ntfs)? Then there would be no manual steps involved and a variant could be provided doing this.
comment:21 Changed 14 years ago by mf2k (Frank Schima)
I see. If you are using the sqlite registry, then there are the pre-deactivate and post-deactivate phases which would work. So the variant should say that the sqlite registry is required.
comment:22 Changed 14 years ago by petri@…
@macsforever: Thanks for the update in general, and the pointers to breaking DESTROOT and the sqlite registry. Will look into it this week(end), especially the sqlite registry issue is new to me (any docs pointers would be helpful!), so if all goes well, expect a new patch from me in not too long a timeframe.
comment:24 Changed 13 years ago by mf2k (Frank Schima)
@petri: I have updated ntfs-3g to version 2011.4.12 in r81181. Also the sqlite registry is now required for Macports 2.0.0. Can you update your patch(es)?
comment:25 Changed 13 years ago by drkp (Dan Ports)
Cc: | dports@… added |
---|
The latest update caused it to start installing mkfs.ntfs into /sbin, which is both undesirable and (I assume) unintended. I fixed it in r81239.
comment:26 Changed 13 years ago by neverpanic (Clemens Lang)
Apparently the downloadable binary version of NTFS-3g uses the DiskArbitration Framework for this and can achieve auto-mounting without overwriting /sbin/mount_ntfs. Have a look at /sbin/mount_ntfs-3g if you have it installed.
comment:28 Changed 13 years ago by petri@…
@macsforever and the rest of y'all contributers :) : I had an accident with broken bones and stuff, so I've yet to catch up with any port-related mail (or most mail, in general). I'm fine now though, although it took many months to resolve, so could you/anyone summarize what you think is left to be done?
comment:29 Changed 13 years ago by petri@…
cal: Not that confident with the DA frameworks, but if someone whips up a nice patch I could help test it.
comment:30 Changed 13 years ago by greg@…
I found this article which has a script for mount-ntfs that automounts NTFS-3g volumes on the desktop and in the Finder sidebar (with a minor caveat):
http://fernandoff.posterous.com/ntfs-write-support-on-osx-lion-with-ntfs-3g-f
It does work, as I tested it with April's NTFS-3g release. Unfortunately, installing Fuse4x and NTFS-3g with MacPorts doesn't work as well as the Tuxera 10-2010 release. Specifically, copying a folder from one volume to another with the Finder only copies the folder, not the contents (not recursive). Which makes it pretty worthless for me. Also, the finder reports the format as "Unknown(fuse4x)" so fuse4x is not providing the finder with the "NTFS" descriptor - is NTFS-3g providing that to fuse4x?
All free NTFS-3g solutions are incredibly slow compared to the paid solutions.
comment:31 Changed 13 years ago by petri@…
Just a quick note: changed my email from …@netatonce.net to …@kelotti.net. Assignment is wrong thusly.
comment:32 Changed 13 years ago by pixilla (Bradley Giesbrecht)
Owner: | changed from petri@… to petri@… |
---|
comment:34 Changed 11 years ago by mf2k (Frank Schima)
Cc: | macsforever2000@… removed |
---|---|
Owner: | changed from petri@… to macports-tickets@… |
This port is no longer maintained.
comment:35 Changed 11 years ago by mf2k (Frank Schima)
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have placed instructions in the wiki to make it work with the Finder. And I added a pointer to that in the notes
field in r119583.
comment:36 follow-up: 38 Changed 10 years ago by ozaktash@…
A little annoyance has emerged recently:
Using the script in the wiki, the mount point is not removed anymore after unmount. This results in creation of a new folder in /Volumes/ with the name "%MOUNT_POINT_NAME 1", "%MOUNT_POINT_NAME 2" ... etc. each time the drive is re-mounted.
It seems to me that this issue has appeared after osxfuse replaced fuse4x.
I am on OS X 10.9.2 by the way with MacPorts 2.2.1.
comment:38 follow-up: 40 Changed 10 years ago by khepler
Replying to ozaktash@…:
Using the script in the wiki, the mount point is not removed anymore after unmount. This results in creation of a new folder in /Volumes/ with the name "%MOUNT_POINT_NAME 1", "%MOUNT_POINT_NAME 2" ... etc. each time the drive is re-mounted.
Looks like that will be fixed in osxfuse 3.0: https://github.com/osxfuse/osxfuse/issues/119
Regarding the mount_ntfs script
http://apple.stackexchange.com/questions/106589/write-in-ntfs-using-mavericks and http://coolestguidesontheplanet.com/how-to-write-to-a-ntfs-drive-from-os-x-mavericks/ show Homebrew providing a mount_ntfs script. I don't use Homebrew, so I can't tell where that comes from. I believe Homebrew patches it in, and it is not provided by the ntfs-3g package proper.
In a similar vein, could we have the port install the wiki's mount_ntfs script somewhere? It would avoid (error-prone) copy+paste steps for users, who would symlink it when desired, and allow Macports to version the thing.
comment:40 Changed 10 years ago by ozaktash@…
Replying to khepler@…:
Replying to ozaktash@…:
Using the script in the wiki, the mount point is not removed anymore after unmount. This results in creation of a new folder in /Volumes/ with the name "%MOUNT_POINT_NAME 1", "%MOUNT_POINT_NAME 2" ... etc. each time the drive is re-mounted.
Looks like that will be fixed in osxfuse 3.0: https://github.com/osxfuse/osxfuse/issues/119
Yes I have been watching that. It looks like we have to wait until osxfuse 3.0 is released and makes its way into macports.
Regarding the mount_ntfs script
http://apple.stackexchange.com/questions/106589/write-in-ntfs-using-mavericks and http://coolestguidesontheplanet.com/how-to-write-to-a-ntfs-drive-from-os-x-mavericks/ show Homebrew providing a mount_ntfs script. I don't use Homebrew, so I can't tell where that comes from. I believe Homebrew patches it in, and it is not provided by the ntfs-3g package proper.
In a similar vein, could we have the port install the wiki's mount_ntfs script somewhere? It would avoid (error-prone) copy+paste steps for users, who would symlink it when desired, and allow Macports to version the thing.
I totally agree with this!
comment:41 Changed 10 years ago by mf2k (Frank Schima)
Adding comments to closed tickets is not likely to get anything accomplished. Please open a new ticket with this request and ideally a patch since this port is not maintained.
ntfs-3g was updated to version 2010.10.2 in r74328.