Check for mounted volume via terminal?

I want to write a simple bash script that will unmount a volume if it's already mounted. How do i check to see if the volume is mounted?
if [/Volumes/Backup is mounted ]
umount /Volumes/Backup
fi

Brian S. Campbell wrote:
I want to write a simple bash script that will unmount a volume if it's already mounted. How do i check to see if the volume is mounted?
Try this:
if \[ -d /Volumes/Backup \]; then
umount /Volumes/Backup
fi
That "umount" command will require root privileges, so you'll have to arrange that.

Similar Messages

  • Unable to Connect to Mounted Volumes via AFP; Local Network

    Server's name is Boing. If I try: Connect to Server: afp://Boing.local I'm given a list of possible volumes. However, this list only includes my home directory and every user's Public Folder. I am an admin user:
    uid=516(mnewman) gid=516(mnewman) groups=516(mnewman),101(com.apple.sharepoint.group.1),105(com.apple.sharepoint. group.3),103(com.apple.accessscreensharing),98(_lpadmin),102(com.apple.access_ssh),81(_appserveradm),79(appserverusr),80(admin),20(staff),106(com.apple.sharepoint.group.4),104(com.appl e.sharepoint.group.2)
    I should have access to all mounted volumes:
    drwxrwxr-t 56 root admin - 1972 May 17 13:39 /Volumes/Banana
    drwxrwxr-x 13 mnewman mnewman - 510 Jan 14 09:17 /Volumes/Farang
    lrwxr-xr-x 1 root admin - 1 May 21 10:46 /Volumes/Fuji -> /
    drwxrwxr-x 12 mnewman mnewman - 476 Apr 20 08:29 /Volumes/Guava
    drwxrwxr-t 17 root admin - 646 May 17 13:39 /Volumes/Lime
    If I ssh into Boing, I can get to everything.
    If a different admin user connects to Boing via afp she can get to everything.
    What has happened to my account that permits me afp access only to public shares?

    Amazing:
    I used Apple's Workgroup Manager to add a short name (mgnewman) to my account.
    Using that short name I can now connect to Boing using the Finder's Go->Connect To Server...
    and, all the mounted volumes are shown.
    Workgroup Manager shows "mnewman" as my default short name. But, it doesn't work right
    for afp connections either through the GUI or command line. But, my newly added short user
    name works just fine. (Oddly, my Dot Mac e-mail address, also shown as a short user name in
    Workgroup Manager, also works....)
    I suspect that the Directory Services database is somehow corrupt.
    Is there a way to rebuild it?

  • Check for mounted DFS share with exists in apple script

    OS: OSX Mountain lion.
    Can any one advise how to detect if a DFS share is mounted or not?
    I have been using the following code:
    set volumeLabel to "R$"
    tell application "Finder"
      exists disk volumeLabel
    end tell
    Which works fine with a normal SMB shares or attached hard drives but I cant get it to work with a DFS Share, it always returns false (see attached screen shot.
    Also tried:
    if volumeLabel is in (do shell script "/bin/ls Volumes") then
              return true
    else
              return false
    end if
    Which didnt work with a DFS Share aswell.
    Any help appreciated.
    Cheers,
    Richard

    Hi,
    Since you're checking to see if a value exists in the Desktop key, you can do something along these lines:
    If (Get-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name SCRNSAVE.EXE -ErrorAction SilentlyContinue) {
    Write-Output 'Value exists'
    } Else {
    Write-Output 'Value DOES NOT exist'
    EDIT: Sam, what version of PowerShell are you running? Your code doesn't seem to work for me on v4:
    PS C:\> Push-Location
    Set-Location "HKCU:\Control Panel"
    $Result = Test-Path -Path ".\desktop\SCRNSAVE.EXE"
    Pop-Location
    $Result
    False
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • How to check folder sizes of the root directory on my VPS/Dedicated server via Terminal?

    Hi,
    I have following issue.
    I have a VPS with Linux OS and I'd like to check size of the folders as well as remaining space on my server.
    How can I do that via Terminal?
    I would appreciate any input.

    login into your VPS server via terminal and cd into the root of your hosted space.  Then use the df -h command to see the listing
    for i.e.
    df -h /volumes/volume_1
    Filesystem             Size   Used  Avail Capacity iused      ifree %iused  Mounted on
    //john@ds00/volume_1  457Gi   12Gi  445Gi     3%       0 18446744073709551615    0%   /Volumes/volume_1
    for you it would be something like:
    df -h [email protected]/share (ip address)

  • Can't see mounted volume of my Canon G9 when camera is connected via USB

    Why can't I see mounted volume of my Canon G9 (with 8GB SD card) when camera is connected via USB. I just want to be able to download the movie files. Aperture does this fine on my other Mac but on my MBP I use Lightroom and it does not automatically download additional files a la Aperture.
    Also can't read via Kensington Multi-SD reader but suspect that's because it is a little older and does not support the higher capacity SD cards

    Digital cameras have several modes in which they can connect to a computer.
    One mode is sometimes called "Mass Store". The camera acts like a USB disk or thumb drive. It appears in the Finder and files can be copied from it. This obviously is what you are looking for.
    Another common mode is called PTP (Picture Transfer Protocol). In this mode, the camera will not appear in the Finder. You use special software to select and transfer the images. There are many applications available to do this: iPhoto, Aperture, Image Capture, the software provided by the camera's manufacturer.
    Consult your camera's manual to see if you can select the mode. My Nikon cameras can be set to either of the modes I mentioned. I think I have heard that Canon supports PTP only. I don't have a Canon, so I can't verify this. In that case you could use Image Capture, or Canon's software, or use a card reader. Card readers are usually faster than the camera anyway.

  • Mounting Server Volumes Via Startup Items

    I'm going crazy here trying to figure out what's going on with my wireless AirPort network!!!
    While trying to set up the first G4 iBook (10.4.2) from an Apple wireless cart I've discovered that I can't get a server volume to automatically mount at startup. I'm connecting to an AirPort Extreme base station. The iBook has no problem detecting and connecting to the base station and allowing an Internet connection and you can manually connect to a file server. But if I add a server volume to the Startup Items I can't get it to mount the volume at startup.
    Here's some stuff I've done to try to isolate the problem but nothing seems to point to a solution:
    - If I connect via Ethernet, it works everytime - so the issue is definately AirPort related.
    - Since I have 3 other independent AirPort networks (Extreme & Dual Ethernet) I tried connecting to them - no help.
    - After startup is finished I can connect manually (Go/Connect to Server).
    - Here's a real stumper... If I log out (not a reboot) & log back in - the volumes mount!!!
    - Up until now I had my personal eMac (10.3.9) connecting and mounting the same volumes via one of my previously mentioned AirPort networks with no problems. In trying to solve this problem I cleared out my Startup Items, Keychains, etc. - now I can't get it to work either.
    - I tried setting a new user in case it was some fouled up user setting - no help.
    - I've cleared out and set up Keychains & Startup Items numerous times - no help.
    - I disabled security - no help.
    So in my opinion I've ruled out the following by process of elimination:
    - System hardware - problem exists with eMac & iBook
    - OS - problem exists with 10.3.9 & 10.4.2
    - Base station - problem exists across differing base stations (Extreme & Dual Ethernet) & differing networks
    - Users - problem exists with new user
    - Security - problem exists with security disabled
    Here's the one thing that seems evident....
    The connection to any Airport network takes a momentary delay during startup - enough to cause to Startup Items (server volumes) not to mount. Since I can connect to the server manually shows that the AirPort connection is good. Logging out & then back in uses an AirPort connection that is already established and then will mount the Startup Items (server volumes).
    I've seen some Internet posts that suggest using scripts to somehow delay certain Startup Items from executing until an AirPort connection is established - I would rather avoid that mess. There's got to be a better solution! This seems to me like a very basic function that shouldn't take scripts or other such voodoo!
    I'm all out of ideas.....
    Dave

    Hi Dave,
    I recently had the same problem. I think a recent update messed up the way I was using applescript to mount drives. I would get messages while the script ran that would indicate things timing out while looking for drives. After reading through a lot of forums I found that this script worked for me:
    tell application "Finder"
         mount volume "afp://user:[email protected]/VolumeName"
    end tell
    This is for mounting a Mac server volume. I think you use smb:// for a win server.
    Let me know if this works for you.
    Herb

  • My firefox beta 12 using Linux platform does not update to firefox RC1 via the "check for update" function. I know windows' beta version had this fixed, when would Linux get similar support ?

    Current platform : Linux
    Current firefox version : Firefox 4 beta 12
    Issue : does not update to RC 1 using the check for update feature.
    Background : previously downloaded beta 8 and then it automatically updated to beta 12 using update features but for RC1, it does not.
    I know users under Windows platform had same problem but was resolved and they can now update via check for update feature.
    Please implement for Linux users too.
    Thanks !!

    If you can't update then you can download and install the full Firefox 4 RC version.
    * http://www.mozilla.com/firefox/all-beta.html

  • I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I know this has been solved as you reported, but I think you need to check with your e-mail provider. Did you also get this same e-mail on your computer? If you use the same ID for e-mail on computer and ipad, it should have appeared on both. It's very common spam. Check your computer to see if on it, the e-mail is in spam, or, if you deleted it on your ipad, check your recently deleted e-mails.
    You might want to consider changing your password, though people sending spam, don't need it. My e-mail provider had me change my password, not because I was getting spam, but unknown to me, I was sending it!  (You'll still get some spam, though.) It's when you learn that you're unknowingly sending spam...that you must change your password.
    Hope this helps.
    (Ss I was sending this, I just got an e-mail notification from the Nigerian... it got to my e-mail instead of going to spam.)

  • CVS extension no longer available via "Check for Updates" ?

    Hi,
    It seems that CVS (or any other Versioning support tools) SQLDev extension are no longer available via "Check for Updates".
    I've just downloaded 2.1.1.64 and tried to setup whatever extensions we used to use and they simply do not appear in the list.
    Can this extension be downloaded as a bundle and installed from local file? Where from?
    Oracle SQL Developer 2.1.1.64
    Version 2.1.1.64
    Build MAIN-64.45
    IDE Version: 11.1.1.2.36.55.30
    Product Version: 11.1.1.64.45
    Java(TM) Platform 1.6.0_11
    Oracle IDE 2.1.1.64.45
    Versioning Support 2.1.1.64.45
    Cheers
    Arek
    Edited by: Arek on Oct 12, 2010 7:11 PM

    Thank you, Sue. Much appreciated.
    FYI. I've just downloaded SQLDev 3EA release and I'm still facing the same problem.
    Default Update Centers available are:
    1) Oracle SQL Developer ( http://www.htmldb.oracle.com/pls/otn/f?p=raptor:updates )
    2) Oracle Extensions ( http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162031.xml )
    3) Third Party SQL Developer Extensions ( http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162031.xml )
    When I mark the first two all I get at the next screen is two entries:
    Oracle Product Extensions for SQL Developer   (Hide) (- which is simply a header I suppose)
    Oracle Rdb Extension 7.3 (Details)
    The CVS extension jars can be copied from previous SQLDev installations (download used to work a couple of releases back), but it should be still available for download via "Check for Updates" or bundled with the product itself.
    Regards
    Arek
    Edited by: Arek on Oct 15, 2010 2:05 PM

  • Exit for delivery Date check in Sales order [Via EDI]

    Hi Friends ,
    We have a requirement in which if the Sales Order is created Via EDI with INVALID delivery date then I have to set a flag in some Z Table . I have tried searching for exits and debugging the code but was unable to find a place where SAP checks for delivery date validity . Please help me with possible exits/Badis?Enhancement Pts etc where I can mark this flag .
    Thanks & Regards
    Gaurav Deep

    @Vinod Thanks  for your reply , the delivery date is there in EXIT_SAPLVEDA_009 .
    But how will i check if the delivery date is valid or not , If you go to VA01 and give a invalid delivery date a warning message is issued , here if the warning message is issued then I want to set my flag , this might save my from  coding redundant delivery date check logic , can someone please help me how can i track if this warning message is issued .
    Thanks & Regards
    Gaurav Deep

  • I had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message erminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object' abort() called termin

    i had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message
    "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object'
    abort() called
    terminate called throwing an exception"
    Can someone help me with solving the problem.

    i had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message
    "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object'
    abort() called
    terminate called throwing an exception"
    Can someone help me with solving the problem.

  • Anyone else getting a timed out error message when trying to check for updates via the app store software on a desktop?

    anyone else getting a timed out error message when trying to check for updates via the app store software on a desktop?

    Hi, couple of things to try...
    Anonymous
    Post subject: NSURLErrorDomain error -1100 in OS X 10.8
    If you check for software updates using the App Store in OS X 10.8 and get "NSURLErrorDomain error -1100" the problem may be with your Software Update preferences. This is particularly likely if you were using a custom Apple Software Update server. To solve the problem, quit the App Store, move the following two files (if present) to the trash, restart, and only then rerun App Store updates:
    /Library/Preferences/com.apple.SoftwareUpdate.plist
    /Library/Preferences/com.apple.SoftwareUpdate.plist.lockfile
    http://x704.net/bbs/viewtopic.php?f=12&t=6130
    I was recently trying to upgrade to mountain lion through the app store.  I have unreliable Internet from a cable company whom I will not name, but we all know who they are.  My Internet dropped while downloading the upgrade.  Once I went through the notorious unplug the modem/router and plugged it back in to gain Internet connectivity again, I could not resume. No matter what I did, the app store kept displaying "an error occurred." I am hoping that those with the same issue read this first to save them hours of skimming through the Internet to find a solution.  Here are the steps to take:
    1. Make sure you have reestablished Internet connection
    2. Chances are you got frustrated when you tried to resume/unpause the download and clicked the "X" to the left.  If so, select the "Store" drop-down menu from the App Store and select "View My Account." There should be an option to unhide your purchase.  You know what to do.
    3. There is also an option to  reset all warnings for buying and downloading under "View My Account." Do this, click "Done," sign out of the App Store and quit the App Store.
    4. Open the Preferences in safari and select Privacy.  Select "Remove All Website Data."  Just do it.
    5. Launch the app store and sign in.
    6. Now, if you "Check for Unfinished Downloads" everything works peachy.
    I hope this helps.  Not much I can do for your Internet connection though.
    JonEz15...
    https://discussions.apple.com/thread/4697970?tstart=120

  • Can't download JUNIT extension via "check for updates"

    Hi,
    since a few weeks (with jdev 11.1.1.1.0 and jdev 11.1.1.2.0) I can't download e.g. JUNIT extensions via "check for updates".
    I have to enter a password but authentication is not possible.
    Even when I reset the passord (via "find password") it does not work any more.
    Im 100% sure that this worked some time ago without problems.
    I can access http://www.oracle.com/technology/products/jdev/101/update/center.xml#oracle.jdeveloper.junit and download the extension manually.
    regards
    Peter

    Peter,
    no problems on my side with my account. I did it yesterday without any problem.
    Timo

  • W2 process & Final Check for Terminated employee (Payroll)

    -- how to create a Final Check for Terminated Employee ?
    --- How are W2 processed?
    thanks

    Hi Arun,
    You need to delimit IT0588 sty 0001... . till 19.2.2014.... (i.e separation date)
    e.g
    Joining date 1.1.2010
    Termination date :- 19.2.2014...
    Delimit the info type with period as 1.1.2010 to 19.2.2014...
    Hope this should solve your issue...
    Regards,
    Veeram

  • How can I set Firefox update preferences via script so I can configure our 200 Macs to disable checking for updates?

    Most of our Mac users do not have admin privileges. So when they get alerted about Firefox updates, they don't have the ability to install them. We would like to disable Firefox for checking for updates, then push out updates from our software server as needed. We have about 200 machines to configure. Is there a way to disable checking for updates via script (bash or Applescript)? And if so, is there a guide or web site to explain the process?

    Use a mozilla.cfg file in the Firefox program folder to lock prefs or specify default values.
    Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.
    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    See:
    * http://kb.mozillazine.org/Locking_preferences
    You can use these functions in mozilla.cfg:
    defaultPref(); // set new default value
    pref(); // set pref, but allow changes in current session
    lockPref(); // lock pref, disallow changes

Maybe you are looking for