> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/deployr/reference/step-definitions/clean-drive.md).

# Clean drive

{% hint style="info" %}
Applies to: DeployR 1.4 and later.
{% endhint %}

The **Clean drive** step removes everything from the existing Windows volume except the `_2P` folder, so that a new operating system image can be applied without reformatting the disk. Anything stored in `_2P`, such as a USMT state store captured by the [Capture user state with USMT](/deployr/reference/step-definitions/capture-user-state-with-usmt.md) step, is kept.

This step has no options. It is used by the [Windows refresh](/deployr/task-sequences/task-sequence-templates/windows-refresh.md) template in place of the **Format disk** step.

### How it works

The step runs in Windows PE after rebooting from the existing OS. It:

1. Assigns the `S:` drive letter to the existing Windows volume and `W:` to the EFI system partition. These match the drive letters that the **Format disk** step assigns, so steps such as **Apply operating system** work the same way afterwards.
2. Copies any `Bootstrap.json` file and certificates from the boot image to the `_2P` folder on the drive.
3. Moves the DeployR state, content, and logs to `S:\_2P`.
4. Deletes everything else on the volume, regardless of ownership or permissions.

{% hint style="warning" %}
Everything on the volume outside the `_2P` folder is permanently deleted. Capture any user data you need first.
{% endhint %}

The task sequence must have been started from the existing OS on this volume, so that the `_2P` folder already holds the task sequence state.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/deployr/reference/step-definitions/clean-drive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
