| |
| | |

Apple Phoon Forum

 Forgot password?
 Register
View: 1759|Reply: 14

Controlling the display name of mount points in Finder.

[Copy link]

Post time: 2013-12-31 16:43:43 |Show all posts
Finder displays the remote name of NFS mounts instead of the local name. How can I make it so that, for example, mounting server:/docs/User1 on ~/Documents will appear as Documents instead of User1 in Finder? I have a ton of mounts that appear one way in the CLI and another name in the GUI. Now, imagine how confusing it gets when I mount server:/docs/User1 on ~/Documents, server:/music/User1 on ~/Music, server:/pics/User1 on ~/Pictures and see a bunch of folders named User1 now in my home dir instead of what they SHOULD be.
Any help resolving this issue would be greatly appreciated!
   
Reply

Use magic Report

Post time: 2014-01-01 13:29:16 |Show all posts
I am very familiar with how mounting works, this ain't my first rodeo.
Mounting overlays the FILESYSTEM, not the NAME. If as defined by UNIX it is supposed to work the way you described, explain to me why the UNIX layer of OS X doesn't work that way. I showed this on the lines immediately following the one you quoted.
To quote the PDF you reference, "The effect of mount is to cause references to the heretofore ordinary file to refer instead to the root directory of the file system on the removable volume." References to the ordinary file are in fact BROKEN when the name changes, they effectively refer to nothing. So by definition, the name should NOT change. It actually makes sense if you think about it. I intentionally mounted a filesystem at a point with a name that MEANS something. In my example, I specifically created the mount point using the mkdir command and gave it the name I wanted it to have. Displaying a different name in Finder is confusing. Try it for yourself:
$ mkdir mnt
$ ln -s mnt usb
$ ls -l usb
lrwxr-xr-x 1 ryan staff 3 Mar 20 12:35 usb -> mnt
The symbolic link "usb" references the "mnt" ordinary file (directory). Assuming an unmounted usb drive attached as disk1, hfs filesystem on slice 2, mount the filesystem onto "mnt" and notice what happens:
$ mount -t hfs /dev/disk1s2 mnt
$ ls -l usb
lrwxr-xr-x 1 ryan staff 3 Mar 20 12:35 usb -> mnt
$ ls mnt
file1 file2
$ ls usb
file1 file2
$ ls
mnt usb
The usb symbolic link still references the mnt directory. This demonstrates that the BSD (or UNIX) level behaves as expected, by keeping the name of the mount point instead of adopting the name of the mounted filesystem. In Finder, you wouldn't be able find the mnt directory. It would be displayed as the label of the mounted filesystem. Let's simulate the chaos that would ensue if the name of the mounted filesystem was adopted:
$ mv mnt THUMB\ DRIVE
$ ls usb
usb
$ ls -l usb
lrwxr-xr-x 1 ryan staff 3 Mar 20 12:35 usb -> mnt
$ ls
usb THUMB DRIVE
The "usb" link still references "mnt", but "mnt" was renamed "THUMB DRIVE" so the link now points to nothing.
The fact that Cocoa displays the name of the volume instead of the name of the point at which it is mounted is purely cosmetic; the actual underlying path is structured as it should be, with the name of the mount point remaining unchanged. The behavior of the core OS is exactly what I want to achieve in the Cocoa GUI elements.
Yes, it currently Works As Designed, but the design would appear to be Apple's (or NeXT's perhaps, I haven't tried this on historic versions of the OS), not that of the creators of UNIX. I'm asking if the Design includes the obscure ability to control the displayed name of mount points in system-wide Cocoa UI elements. Please don't say I'm doing it wrong. I just want to know if something is possible. I hope this doesn't seem unreasonable.
Reply

Use magic Report

Post time: 2014-01-01 11:45:43 |Show all posts
This works, but it's a bit clunky. And it's annoying that I have to do this at all, simply because OS X behaves inconsistently.
This is called a WAD -- "working as designed" as in crunch it up & throw it in the trash can or UE -- User Error as in u-turn.
mount -o vers=4 fileshare:/music /Volumes/Shared\ Music
Unix defines the mount command to work this way. The mount point "Shared Music" is going to get overlay with the mount name. It makes sense when you think about it. You do not want to get confused between the mkdir and the remote name. Remember mount is used for all external media. You do not want you flashdrives label: a: b: z: etc do you?
If you do not like it, get in your time machine. Go back to Murray Hills, NJ. Find Bell labs. Speak to Dennis M. Ritchie and Thompson. Ask for a change. If you time macine is out of q-ton, you will have to live with it.
The UNIX Time-Sharing System, Dennis M. Ritchie and Ken Thompson, Bell Laboratories
Reply

Use magic Report

Post time: 2014-01-01 10:27:54 |Show all posts
Thanks rccharles for the tip about Rez, I'll have to take a closer look at the resource forks. I nearly forgot they existed
Reply

Use magic Report

Post time: 2014-01-01 08:42:29 |Show all posts
Thanks for the idea, but as I already mentioned, I don't need suggestions for a workaround, I came up with one on my own when I first discovered this behavior. I'm in fact doing as you describe, nesting one layer deeper to have the name on the server match what I expect on the client. This works, but it's a bit clunky. And it's annoying that I have to do this at all, simply because OS X behaves inconsistently. I don't have the same problem on Windows; NFS shares mounted on folder "ABC" do not decide to call themselves "ZYX" in the user interface. Same with the X11 toolkits. OS X is the odd one out. And it's just Cocoa it seems; X11 apps on OS X behave the same as they would on other operating systems.
So again, I've already implemented a workaround, I'm just curious if it is possible to change the behavior.
Reply

Use magic Report

Post time: 2014-01-01 07:16:26 |Show all posts
I know you could mount them anywhere, though I don't think that I have tried.
I was wondering if the Finder would see the mount point if it wasn't in Volumes.
Ubuntu. Those folks solve all issues with a set of terminal commands. It's a good way of increasing your Unix skills. The last time I used Ubuntu they changed the GUI so I couldn't figure out how to troll around the filesystem.
Robert
Reply

Use magic Report

Post time: 2014-01-01 05:28:09 |Show all posts

No, you can mount anywhere; /Volumes is the default. All mounting means from a file system perspective is attaching one tree-hierarchy to another. It usually make sense to do that down near the root, but there are sometimes reasons to do otherwise. And creating a symbolic link wouldn't really solve the problem: the mounted file system has to be attached before a link can point to it. I suppose you could mount the volume and hide it from the user so that they only see the link, but I think that would come with its own set of headaches.
As for the cross-platform stuff, I'm a Mac guy. All I know about Ubuntu is that it's a great word to shout at people on Halloween night.
Reply

Use magic Report

Post time: 2014-01-01 04:23:54 |Show all posts
well, twtwtw how adventures are you? For awhile, I had several Ubuntu linux machines setup in parallels. I had my login scripts ( .bash_profile ) shared by mac os & linux os. Get Oracle Virtual Box and run Ubuntu/Windows/etc. in it.
I thought you needed to do all the mounts in /Volumes for the finder to see them? It's not clear to me where the mounts were taking place. Maybe I had the info wrong?
I did run across the page on how to change the folder icon.
http://www.jcsenterprises.com/Japamacs_Page/Blog/A212A8B7-C222-46E5-9AD6-5FE950A 244C5.html
This page talks about the command line equivalent.
http://apple.stackexchange.com/questions/6901/changing-a-file-or-folder-icon-usi ng-the-terminal
You may have to adjust for a remote server. Don't know. If it doesn't work on the client, may you could create the files on the server. Maybe using those funny resource names.
Have you played around with renaming the folder?
How about the ln command?
Robert
Reply

Use magic Report

Post time: 2014-01-01 03:03:41 |Show all posts
Well, last suggestion I have to offer is low-brow but effective. Use what I'm going to colorfully call shill folders: an extra directory layer added solely for naming purposes. In every UserX folder, add a new folder with the display name you want, dump all of the contents into that new folder, then use the new folder as the mount point. In other words, use this file structure:
server:/docs/User1/docs
server:/docs/User2/docs
server:/docs/User3/docs
If you have a lot of folders to handle it's trivial to script in applescript.
As far as getting a response from 'the guy at apple'... It would probably be a more effective use of your time to write it in a letter to Santa and mail it to the North Pole. At least that way you'll only be disappointed one day out of the year...
Reply

Use magic Report

Post time: 2014-01-01 01:49:35 |Show all posts
Well, you can't mount on a directory that doesn't exist, and mkdir /Volumes/Music && mount server:/music /Volumes/Music still shows up as music instead of Music. I did notice that some magic occured and /Volumes/Music gets removed automatically when I unmount, but that's trivial. Thanks for looking into it anyway, but I guess my best hope is that the guy at Apple who wrote this part of the OS will respond with something along the lines of "I'm surprised you are the first person to ask for this, just use `defaults write -g NSMountsUseRemoteName FALSE' to change that behavior."
*fingers crossed*
Reply

Use magic Report

Post time: 2014-01-01 00:43:10 |Show all posts
Out of my area of expertise really, but a quick google led me to this post from an older discussion, which leads me to think you should try a mount point rather than just a name in your mount command. i.e.
mount -o vers=4 fileshare:/music /Volumes/Shared\ Music
I don't have a remote device to test it with, sorry, so I can't tell you if it works as advertised.
Reply

Use magic Report

Post time: 2013-12-31 23:14:39 |Show all posts
Sorry if it seemed like I snapped, I just wanted to clarify my question. I apologize if I hurt anyone's feelings.
I thought it was a pretty straightforward question and that the details of my specific situation would be irrelevant, so I made up a generalized example to illustrate a scenario which would present the behavior I wish to change.
Now I'll divulge a bit more detail, to at least give you a better picture of what I'm doing, even if it doesn't necessarily pertain to my question.
I use different filesystems for different data types. The server is running FreeBSD, and storage is all in ZFS pools. I have the data stored separately by type, because it really does make sense to do it that way. Videos and music have compression and dedup off, on fast access storage, and the filesystem is tuned for large files and fast sequential reads. Documents and downloads compress well, and these files typically do not require streaming from disk so the storage can be slower without it being a problem. Other data types benefit from other configurations. Separating datasets like this also allows me to tune both the filesystems on the server and the mount parameters on the client for each dataset. Furthermore, it can help keep storage responsive under load.
I realize that this may seem completely asinine, but none of the above is relevant to my question. I simply wish to know if it is possible for OS X to be configured to display the name of the directory upon which a remote filesystem has been mounted, instead of displaying the name of the remote directory. In other words, I wish for the GUI to use the same naming conventions as the CLI.
Another example:
workstation:~ coder$ mkdir "Shared Music"
workstation:~ coder$ mount -o vers=4 fileshare:/music "Shared Music"
workstation:~ coder$ ls
Desktop Downloads Movies Pictures Shared Music
Documents Library Music Public
workstation:~ coder$ ls "Shared Music"
Sublime
In the Cocoa interface however, that directory would be displayed as "music", but I want it to display "Shared Music".
I have already figured out my own workarounds, I would simply like to know if there is a way to change this behavior in OS X, if only for my own knowledge.
Reply

Use magic Report

Post time: 2013-12-31 21:35:38 |Show all posts
I really have only a vague sense of what you're trying to do - your question isn't very clear on the details - but I think you're approaching the problem from the wrong direction. in multi-user contexts (I'm assuming that this is multi-user), file systems are usually structured with separate areas for users, not by data type. in other words, you seem to have:
server:/docs/User1
server:/docs/User2
server:/docs/User3
when you ought to have:
server:/Users/user1/docs
server:/Users/user2/docs
server:/Users/user3/docs
if you work against file system conventions you're always going to give yourself headaches.
P.s. Please don't snap at people. You're here asking for free advice, and this site gives remarkably good value for what you spend. But nothing's really free in this world, right? Consider being gracious to people who give you answers you don't want as part of the fee we charge.
Reply

Use magic Report

Post time: 2013-12-31 20:01:37 |Show all posts
I think you misunderstood the question. Or maybe you didn't read it. To clarify:
I want to make Finder display the name of the mount point, NOT the name of the remote folder. If I could get it to keep the original icon instead of the net drive icon as well, that would REALLY make my day.
So server:/docs/User1 mounted on ~/Documents should be displayed as Documents, not User1
I guess maybe this isn't so much Finder's doing, as it happens in all system file browser components. So the solution to my question must apply across all the system dialogs as well. I don't want to open a file upload dialog in Chrome and have to search through a load of folders with the same name.
Also, please do not suggest mounting somewhere else, or renaming the folders on the server.
Reply

Use magic Report

Post time: 2013-12-31 18:32:49 |Show all posts
Have you tried mounting them in
/Volumes/
Robert
Reply

Use magic Report

You have to log in before you can reply Login | Register

Archive| Apple Phoon

2021-04-18 06:58 GMT-8 , Processed in 0.103741 sec., 27 queries .

Powered by Discuz! 7.2

Release 20121101, © 2001-2021

To Top