We use Windows Server for my company network.

I do use Mac has client. When I mount a network drive, I use the following command line:

osascript -e ‘mount volume “smb://myusername:mypassword@fileserver/department/its”'

everything works fine. I am a user administrator for my network, this is the reason why I guess I am able to mount the network drive in this way and everything works fine.

But my question is: how do I unmount this network drive? What is the command line?

thank you so much

1 Answer 1


umount is the opposite of mount. You'll need to know the name of the mount point - that is, the name in /Volumes that corresponds to that network drive.

umount /Volumes/VolumeName

Per man umount, umount may fail for any number of reasons, and the recommend command is instead diskutil:

diskutil unmount /Volumes/VolumeName
  • And this is where the confusion comes for me :-) By using the command line that I posted in my original post, does the command line creates a mount point too? or it just mount the smb drive without creating the mount point? The reason why, I receive error message when I execute the following command: diskutil unmount /fileserver/department/its I receive the following error: Unmount failed for /fileserver/department/its or if I execute: unmount /fileserver/department/its I receive: -bash: unmount: command not found Commented Oct 6, 2016 at 20:44
  • 1
    /fileserver/department/its is not a mount point. Unless otherwise specified with a specific mount point, everything is mounted under /Volumes. You will need to list the contents of that directory and find out what the corresponding name is to your network share. It's probably its since that's the last bit of the path from the server.
    – tubedogg
    Commented Oct 6, 2016 at 20:47
  • Done. Thank you. The answer was: diskutil unmount its Commented Oct 6, 2016 at 20:52
  • 2
    The other thing is from your previous comment - note that the first command is umount not unmount (notice that the proper command has no "n" in it). That's why you got "command not found" trying to run unmount. diskutil by contrast uses the actual word (with the "n"): diskutil unmount.
    – tubedogg
    Commented Oct 6, 2016 at 20:55
  • There is also a force option diskutil unmount force /Volumes/VolumeName
    – AndrewC
    Commented Dec 3, 2023 at 23:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .