Mounted network volume info

We have two file servers each with multiple shares. I've been looking for a method by which applescript examines all mounted volumes on the desktop and determines which network shares come from which file server. No luck so far. I realize that I could just build a table (we're only talking about a few dozen shares on two servers), but I'd rather have a dynamic solution for a variety of reasons. Anybody have any suggestions?
Thanks.

Hello StiffMittens,
You may possibly be able to extract server information from alias of shared volume.
Like the following. The first two are getting dump data of alias record, the last one is using 'alias description for' command of Satimage OSAX.
Only if they contain some useful information to identify server...
Good luck,
H
--SCRIPT1
set a to "AFP_VOL:" as alias
return {{«class TEMP»:a}} as string --record dump (undocumented method)
--END OF SCRIPT1
--SCRIPT2
set a to "AFP_VOL:" as alias
set fp to "" & (path to "desk") & "alias dump.txt"
writeData(fp, a, {_append:false})
on writeData(fp, x, {append:append})
  text fp: output file path
  data x: anything to be written to output file
  boolean _append: true to append data, false to replace data
local a
try
open for access (file fp) with write permission
set a to fp as alias
if not _append then set eof a to 0
write x to a starting at eof
close access a
on error errs number errn
try
close access file fp
on error --
end try
error "writeData(): " & errs number errn
end try
end writeData
--END OF SCRIPT2
--SCRIPT3
  using Satimage OSAX
  http://www.satimage.fr/software/en/downloads_software.html
set a to "AFP_VOL:" as alias
return alias description for a
--END OF SCRIPT3
Message was edited by: Hiroto

Similar Messages

  • Auto-mount network volumes upon changing locations

    As I am shifting my Macbook between office and home and with working in office I need to access frequently into a few network locations which I ended up mounting them regularly manually.
    Any solution on that so I can pre-set what volumes to mount upon changing locations?
    Or perhaps auto-mount network volumes upon joining a particular SSID?

    I'm sure there's a way to Script it, but that being beyond my capabilities, here's how I'd do it using Dynamic mounts...
    Make two New Folders on the Desktop, (Office and Home might be good names).
    After Mounting the Volumes at work, drag the Globe Icons to the Office Folder, after mounting the Shares at home, drag them to the Home folder, (you can even rename them once in the folders).
    Drag those two Folders to the Dock between Applications and Trash to have two popup menus for nearly instant connecting.

  • Mounting Network Volumes in the Command line

    What is the command for mounting a Network volume in a command line.... Plus when done this way will it get the password from keychain?

    The command in question is mount:
    <pre class=command>mount -t type server:/path/to/share /path/to/mountpoint</pre>
    This will mount the share /path/to/share from server server using protocol type (e.g. 'afp', 'nfs', 'smb'). The sharepoint will be mounted at the local /path/to/mountpoint
    mount will not use the keychain. If you require passworded access you can either include the username and password in the command, or switch to using an AppleScript solution which can use the keychain, and can be involked via osascript:

  • Un-mounting network volumes with command line

    Does anyone know how to unmount a network volume from the command line in OSX. Using umount deletes the mount but not the mount point. I can't get diskutil or disktool to do it.

    I don't use smb much, but it does look like there's something funny going on. On my system, smb shares mounted from the "Finder" are unmounted normally (mountpoint deleted, "Finder" icon gone) using: 'umount', or eg.<pre>osascript -e 'tell application "Finder" to eject disk "volumename (not mountpoint name)"</pre>But shares mounted using 'mount_smbfs' behave as you describe with respect to the "Finder". But I couldn't reproduce the ".autodiskmounted" file issue in my limited testing involving "normal" use. Sorry, I don't have much more to add - maybe someone more familiar with smb can comment...

  • Mount network volume: different users same credentials, see different shares

    A set of network volumes on a NAS need to periodically be backed up to a local USB disk. Manually, I can mount most shares (from a Finder window). In a shell script I can list all files due (find) and use that list for backing up to a local USB volume (cpio). So far so good. However, I need to mount these network volumes first. The mount command doesn't seem to work for me.
    How do I mount a network volume in a shell script?
    Also I noticed that if under fast user switching user A logs in with credentials uName and uPassword, the NAS shows 6 shares to choose from. When user B on the same machine logs in with the same credentials uName and uPassword, only 5 shares are visible and one is not shown. It looks as if the credentials do not uniquely determine the volumes offered for mounting. Also, when user B mounts a share, it appears to be owned by user A (who is logged in but has not mounted any share on the NAS) rather than owned by B or by uName...
    How do I mount this volume as user uName rather than A or B?
    How can one uniquely determine the identity of the volume? Network volumes don't show UUIDs and the name given in the /Volume/ folder can change, as is discussed in message 11871367.

    eljonco wrote:
    I just checked: after a reboot, user A logs in (automatic login enabled), user A logs out, user B logs in, ls -a /Volumes only shows local HD and a USB HD. No network mounts there.
    In the finder window, the NAS shows up on the left. Clicking it and entering credentials uName, uPassword, a list of five, not 6, items is offered for mounting. So your options 1 and 4 are then ruled out, unless an alias made by user A and copied to user B's home folder would still link to user A's mounting options.
    Actually, only option 1 is ruled out. That Finder list is simply not reliable. It is likely cached somewhere and could be restored by deleting some hidden preference file. It regularly causes people to freak out when they see some sharepoint listed on a network that they have long since left.
    If you did Go > Connect to Server in the Finder and typed in the location, you could still create an alias.
    Once mounted one of 5 shares as uName with uPassword, an ls -al /Volumes shows the local drives and
    drwx------@ 11 B staff <date> sharename
    and all folders in sharename also show B:staff as user:group. I find that strange, as I did not log in to the share with credentials B, but with credentials uName. Anyhow.
    The uName user is for the network share. When MacOS X mounts that, it gives it permissions appropriate for the user who did the mounting. If you did an NFS mount as root, the server would handle permissions via UNIX uid and gid. I'm really not familiar with the details of AFP.
    As I read in a post about autoFS that 'cd /Volume/theHiddenShare' should magically mount that share, I gave it a shot. Alas, '/Volumes/theHiddenShare: No such file or directory'. Same long shot in the dark in the 'Go/Connect to' dialog gave 'The folder cannot be found'. Not surprisingly, I suppose.
    Yes. That has to be setup
    Here is what I've done to my /etc/auto_home:
    # Automounter map for /home
    #+auto_home     # Use directory service
    # Get /home records synthesized from user records
    #+/usr/libexec/od_user_homes
    myserver.org -allow_other,reconnect,fstype=sshfs [email protected]:/home/me_remote
    I'm not on a big network, so I've disabled the system functionality by commenting out "+auto_home" and "+/usr/libexec/od_user_homes". Now, the system doesn't manage /home and I am free to do with it what I want. This will mount the path "/home/myserver.org" connected to the "me_remote" user on "myserver.org". I'm using the funky MacFUSE sshfs filesystem. Your AFP file system should work much better. Your line would look something like this:
    drive5 -fstype=afp uUser@MyLocalServer:/theHiddenShare
    Run "automount -vc" to reset your automount system.
    Next use Finder Go > Connect to Server and type in "afp://uUser@MyLocalServer:/theHiddenShare".
    You want to mount the drive once so that you can store uPassword in your keychain.
    Now unmount the drive.
    The Finder mounts all go into /Volumes and, as you have discovered, can get themselves confused. This automount will be at "/home/drive5". All you have to do is enter that folder in the Finder and it will be automatically mounted. If you haven't used it for a while, it will be unmounted automatically.
    You may have to play around with this a little. I don't have any network AFP share that I need to mount on a regular basis, so those parameters may need to be adjusted somewhat.

  • Why don't network volume mounts (login items) configured in Profile Manager show up

    Using Lion server and Lion clients.  Bound both the server and client to Active Directory and successfully got Profile Manager up and running.  All I really need from Profile Manager is the ability to mount network volumes so when the user logs in it mounts their home directory.  Please note we do not specify any home directory paths in AD.  I can login with my AD accounts on the Lion client and get other Profile Manager settings to work, however when I try and mount a network volume via login items nothing happens.  I am using SMB for this.  If I try to manually connect to the same path via Go -> Connect To Server it works fine.  For a simple test I even created a folder on one of my Windows servers D drive and shared it and within profile manager configured it as SMB://server/share and still nothing.  I tried setting it in the Dock section as well which I read in another post somewhere but all I get is a question mark.  I have tried all variations of server name, FQDN, ip address, etc.  I know it's not permissions since it works when I try it manually so am really at a loss here.  Is there any way to log what happens at login to see if it's even trying to mount the volume?  I do know the client is getting the profile since i can see it in system preferences but it never works.  Any ideas would be greatly appreciated, thank you!

    @bkma did you find any solution? i run into the same problem.

  • Network Volume adding Numbers and centralized libraries

    Hello,
    I would like to know what determines the numerical suffix to the network mount points. Currently I have a mac mini sharing my family iphoto library and music that two macbook pro's connect to. Currently my issue is in using iphoto library manager, it says to mount network volume before opening the iphoto library, but for some reason the library volume keeps changing.
    Sometimes I'll login and it'll just be Pictures, next time it'll be Pictures-1, Pictures-2, etc.
    The same thing happens when I use Time Machine shared disks, etc.
    When I login through Finder, everything is ok, but I don't like having to always go into settings and re-find libraries for photos/media/etc.
    This leads me to ask a few questions...
    1) Is there any way to ensure that the volume names always stay the same?
    2) I am looking to at some point implement Snow Leopard Server, and I need to know that if I have shared volumes over the server, that this won't happen. Specifically, I'll be logging into the server from different countries and I can't imagine having to constantly remotely manage it to fix volume names.
    Currently, all of these drives that are showing as numbered suffixes are network drives (time capsule/NAS/Mac Mini shares over Wifi) so I'm trying to figure out what the underlying problem is so that I can minimize/eliminate it.
    This is very frustrating for me as this is my first Mac setup and I jumped in headfirst with the whole family system, but I've spent years managing networks on PCs and I've never encountered this problem. I am trying to centralize our home network like I've done at other locations but before I invest further, I want to know that these little annoyances won't be a hinderance.
    Thanks!!

    I'm having the exact same issue, which breaks all my references to the volume. I have to update the path to include the new number <volumename>-5 currently. The problem happens when I do a restart, or loose network connection for other reasons. I happens on my desktop (Mac Pro) and my laptop (MacBook Pro) when mounting to my Tiger Server (PowerMac G5). It is extremely frustrating and makes code development a pain in the butt when I use my server for file storage.

  • Cannot see the correct network volumes

    I have recently added a new user account with administrator priveledges when I try to use that account to mount network volumes then the only volumes I see are "Applications", "Library" and "Users". Apple knows about the problem because they address it on their website and in Mac Help. They state that it happens if auto login is selected, in my case this is off and their 2nd fix is to log out and log back in again. This doesn't help either! The other users don't have this problem.
    Does anyone know who I can see the network volumes again?

    I had that problem, but it was for all users, so I don't think what worked for me on that would be the same for you.
    Might try dragging that user's pref folder to the desktop & relog...
    /Users/nnnn/Library/Preferences
    Though some user stuff is still in...
    /Library/Preferences/SystemConfiguration/
    /Library/Preferences/

  • Stop automatic mounting of network volume

    I have a MacBook that is on a Windows network and connects to a 2003 server. Any time the MacBook is on it tries to auto mount a network volume on the Windows server about every minute or so using an account of an old user. This results in locking the user out of the network about every 5 minutes. I am looking for a way to shut this off.
    I have looked in the startup items and can’t find anything. I have also checked in the Login items under the user accounts with no success. Any ideas would be very helpful.

    To stop the automatic mounting of a network volume, try looking at Finder, Preferences, Shared, and uncheck the Connected Servers. I don't know if this solves your real problem of (deleted user) drive mapping, but at least it stops trying to mount the volume.

  • Auto mounting different network volumes

    I have a MacBook Pro. I use it at the office and at home. When I am in the office, I have one set of network volumes that I mount. At home, I have another (e.g. Airdisk, iMac HD, etc.)
    I would like to figure out a way to have the right drives mounted based on where I am. Obviously, I can add aliases to my desktop and do it manually. Or, I can add them al to my user login options. But when I do that, I get error messages because my office drives aren't there at home and vice versa. Setting up different users doesn't seem to be the solution because I don't want to segregate my data, apps, etc.
    Any ideas?

    EdMartin wrote:
    I log off (power off) between locations. I'm static IP at work but not at home.
    then you can do something along the following lines.
    Paste the following into Script Editor (it's in /Applications/Utilities).
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    delay 10
    set current_ip to do shell script "ifconfig |grep inet |tail -1 | awk '{print $2}'"
    if current_ip = "work.ip.address" then
    mount volume "afp://[email protected]/worksharename"
    else
    mount volume "afp://[email protected]/homesharename"
    end if</pre>
    Edit the script as needed. if your shares are smb and not afp change afp to smb in the above. save the script as an application and add it to the login items.

  • Automatic re-mount of networked volumes after reboot

    Hello.
    Does anyone know if its at all possible to automatically re-connect network volumes after a reboot? Or if there's an app out there to do just that?
    I really don't want to have every network volume (I have LOTS) in the dock...

    Yes this works, but I have been unable to find out how to do this without opening the root of the volumes after the reboot. I tried "Hide Item" in the Login Items control panel, but to no avail.
    Anyone have any ideas?

  • Share a mounted AFP volume across user accounts on the same computer

    Hi all,
    I have a Mac Mini with several attached disks (HFS+). I'm using it as a file server, to share these disks over my home network. I'm mounting these as AFP server volumes on a second computer (MacBook Pro). This all works fine. Both are running MacOS 10.6.2.
    The problem is that my MacBook Pro has two user accounts, and when I mount AFP volumes under one user, the other user can't access them. It seems that mounted AFP volumes are assigned read/write permissions for only the user that mounted them.
    Ideally, I'd like to mount a volume once, and have it accessible from both user accounts. I've tried changing permissions in the AFP volume's Get Info window, but the changes don't take effect.
    Does anyone know how to do this? Thanks!!
    cjb

    Rick
    I'm no expert in this department, but I believe that your question was the reason Apple started the 'Group' calendar. Check this page out:
    http://www.mac.com/WebObjects/Groups.woa/wa/afterLogin?cty=US&aff=consumer&lang= en
    Perhaps your answer lies within.
    * Guy

  • All Network Volumes set as Login Items open in Finder on EVERY startup

    ...after updating to 10.5.8
    I have a Mac running on an otherwise all PC network. Before updating to 10.5.8 I had 5 network volumes set to "connect" on startup automatically (System Prefs / Accounts / Login Items). This worked perfectly and connected to these volumes silently without me having to ever worry about it. I didn't even have to check the "Hide" boxes.
    After updating to 10.5.8 however, it became completely annoying. Now it still connects to these volumes, but opens up every single one in Finder upon every startup. That's 5 windows I have to close every time I startup my computer. It may not sound like the worst thing in the world, but mind you I have to log out and back in every day for work. Even checking the "Hide" checkboxes don't do anything.
    Anybody experiencing the same problem? Anybody know a workaround or fix? My company has a rather large and complex network so staying connected to certain folders that I use is a must. Thanks.
    Screenshots:
    Login Items - http://img.photobucket.com/albums/v326/Magick0ne/Other/Login_Items.jpg
    Every Startup - http://img.photobucket.com/albums/v326/Magick0ne/Other/Finder_Windows.jpg
    Message was edited by: Pifman

    Pifman wrote:
    Thanks to both of you. I guess the search I ran wasn't good enough as I didn't find the discussion that you posted.
    One of the possible workarounds posted there was to use a third-party program that I found difficult to understand and use. Instead I took V.K.'s advice and made an AppleScript and then made that script launch at login. Works like a charm.
    Only difference is that my AppleScript isn't located in the Utilities folder (10.5.8), instead I got to it by going to Applications / AppleScript / Script Editor.
    sorry, my mistake on the location.
    Then I made a script and saved it as an application. I then put that application in my Login Items (System Prefs / Accounts / Login Items).
    If you're having trouble finding the mount volume (or server) address, here's how you can find it: If you are currently connected to the volume(s) that you want to use, left-click it and hit Cmd+I (or right-click, Get Info). Use the address next to "Server:" - That's it!
    Hopefully Apple will fix this bug soon so people don't have to make AppleScripts just to make the OS work correctly.
    I wouldn't bet on it for leopard. leopard development has stopped now after snow leopard has been released. historically, Apple only releases security patches for old OS versions once a new one comes out. Interestingly, this bug is present in snow leopard too! or maybe they don't consider it a bug and this is how it should work. one can make a case for this, I guess.

  • ZFS tries to mount SAN volume before ISCSI is running

    I am running Solaris 10 x86 U7. It is actually a VMWare guest (ESX4) on a Sun X4170 server- although I do not believe that that is relevant. I have a Sun 2510 iSCSI SAN appliance. I have an iSCSI volume with a ZFS Pool that is mounted on the server. All was fine until yesterday when I installed the following patches:
    142934-02 SunOS 5.10_x86: failsafe patch
    142910-17 SunOS 5.10_x86: kernel patch
    144489-02 SunOS 5.10_x86: kernel patch
    142912-01 (as a dependency requirement for one of the others.)
    I had installed the patches in run level 1 , then switched to run level S to allow the patch install to finish.
    Now, when I restart the zfs volume on the san is marked as off line. the /var/adm/messages shows the following
    Nov 7 00:26:30 hostnameiscsi: [ID 114404 kern.notice] NOTICE: iscsi discovery failure - SendTargets (ip.ad.dr.ess)
    I can mount the SAN ZFS pool with
    #zpool clear ZFSPOOL1
    #zfs mount -a
    For iscsi device discovery, I am using send targets (not static or iSNS.) I am not using CHAP authentication.
    It seems to be me this may merely be a timing in services and not fundamentally an iscsi issue. Can I tell the OS to wait for a minute after starting iscsi service before continuing with zfs mount and autofs shares? Can I tell the OS to delay mounting non OS zfs pools?
    Thanks

    Here is what I tried. Installed Batchmod and Xupport on each of internal system disk, backup internal system disk and external system disk. Batchmod could not find the folders automount or Network.
    Booting from external disk, I made hidden files visible using Xupport, then deleted automount > Servers, automount > Static on internal disk and backup disk. The folder Network had no files or folder named "Server". Booting from internal disk, the desktop tried to mount server volumes. Examining the internal disk automount folder showed aliases for "Servers" and "static". Get Info said they pointed to originals "Servers" and "static" in folder /automount but these items do not appear in the Finder.
    Sometimes icons, not aliases, for "Network", "Servers", and "static" appear on all three desktops on login. Trying to eject these icons by dragging to Trash or highlighting and clicking File > Eject has no effect. Examining Users > Username > Desktop does not show these items. Sometimes ".DS_Store" appears on desktop and in folder Users > Username > Desktop.
    Next I deleted user accounts so that all system disks are single user. Booted up on External disk and deleted automount > Servers, automount > Static on internal disk and internal backup disk or their aliases, whichever appeared in Finder. Booting up on internal disk results in... desktop trying to mount server volumes.
    Will try an archive and install on internal disk.

  • Backup Controller cannot mount XSAN Volume

    Hi Guys,
    I've really have a big problem regarding the XSAN that I've just setup: There are 3 Xserves connected to the SAN - one for the main controller, one for backup and another one for fileserver. After a fresh install of the Leopard Server 10.5.6 on all servers and fresh install of Xsan 2.0 updated to 2.1.1, I tried creating an SAN from the main controller, I added first the main and backup controllers, authenticated them properly and was successful adding them to the SAN. After this, I created the volume and it mounted properly on the main controller. What I don't understand is that whenever I try to mount the volume to the backup controller, it is saying unable to mount and even I tried forcing it to mount in terminal using the command xsanctl mount VOLNAME, its giving me an error saying
    "unable to mount volume, Cannot mount XSAN volume error code: 5"
    What is that error message? When I tried typing cvadmin to the main controller, it only gave me this message:
    Main Controller:
    File System Services (* indicates service is in control of FS)
    1>*XSAN[0] located on 10.0.0.101:49930 (pid 317)
    Select FSM "XSAN"
    When I type the same cvadmin to the backup controller, it gave me this message:
    Backup Controller:
    File System Service (* indicates service is in control of FS)
    1> XSAN[1] located on 10.0.0.102:50384 (pid 331)
    No FSSs are active
    Select FSM "none"
    What is happening? both servers are having a DNS name. Before I created the SAN, from the authenticate window, the server name is just the IP address of the Ethernet 0 (first ethernet port). Now whenever I fire up Xsan Admin, both controllers are now offline and if you authenticate them, the server name info suddenly changed from IP address to a DNS Name (e.g. from 194.170.34.12, changed to hct-mdc.ad.hct.ac.ae) which even if I type my admin username and password cannot authenticate saying "server not found in network"
    I really don't know now what to do and they need to fix the issue asap.
    I would really appreciate your help guys!
    Thanks.
    jantoniophi

    Hi,
    I am accessing this WS via ARD, so public LAN is definitely there. I have not connected the "Xsan" network (but it should be no problems communicating the Xsan traffic over this single LAN connection).
    With the firewall, the situation is more strange. When I try to open the Firewall settings on Sharing, there is a dialog "Other firewall software is running on this computer." I googled this and it seems that this was a common problem on 10.3. They suggest to delete com.apple.sharing.firewall.plist file but it is not there on 10.4.
    "sudo ipfw list" shows this:
    00001 allow udp from any 626 to any dst-port 626
    65535 allow ip from any to any
    Any ideas on how to make Firewall behave as expected? I will try to reinstall if I don't receive a reply.
    Thanks.

Maybe you are looking for