<!--
{
  "availability" : [
    "macOS: 15.4.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/Operations/deactivate(options:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeOperations(im)deactivateWithOptions:replyHandler:"
  },
  "title" : "deactivate(options:replyHandler:)"
}
-->

# deactivate(options:replyHandler:)

Tears down a previously initialized volume instance.

```
func deactivate(options: FSDeactivateOptions = [], replyHandler reply: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`options`

Options to apply to the deactivation.

`reply`

A block or closure to indicate success or failure. If activation fails, pass an error as the one parameter to the reply handler. If activation succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

## Discussion

Set up your implementation to release any resources allocated for the volume instance.
By the time you receive this callback, FSKit has already performed a reclaim call to release all other file nodes associated with this file system instance.

Avoid performing any I/O in this method.
Prior to calling this method, FSKit has already issued a sync call to perform any
cleanup-related I/O.

FSKit unmounts any mounted volume with a call to `unmount()` prior to the deactivate callback.

---

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)