<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileManager/unmountVolume(at:options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileManager(im)unmountVolumeAtURL:options:completionHandler:"
  },
  "title" : "unmountVolume(at:options:completionHandler:)"
}
-->

# unmountVolume(at:options:completionHandler:)

Starts the process of unmounting the specified volume.

```
func unmountVolume(at url: URL, options mask: FileManager.UnmountOptions = [], completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`url`

A file URL specifying the volume to be unmounted.

`mask`

A bitmask of [`FileManager.UnmountOptions`](/documentation/Foundation/FileManager/UnmountOptions) that you can use to customize the unmount operation’s behavior.

`completionHandler`

A block executed when the unmount operation completes. The block receives an error parameter which is `nil` if unmounting was successful. Otherwise, it indicates why unmounting failed.

## Discussion

If the volume is encrypted, it is relocked after being unmounted.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)