> For the complete documentation index, see [llms.txt](https://docs.vergeos-demo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vergeos-demo.com/knowledge-base/virtual-machines/vm-disk-discard.md).

# VM Disk Discard

The **Discard** option on a VM Disk in VergeOS is responsible for managing unused storage blocks by issuing **TRIM** or **DISCARD** commands. When **Discard** is enabled, the system automatically frees up unused blocks, helping to maintain efficient storage usage on the **vSAN**.

## Enabling or Disabling Disk Discard

When creating or editing a VM disk, you have the option to enable or disable **Discard**. By default, **Discard** is enabled, and it is highly recommended to leave it enabled for optimal storage efficiency. When **Discard** is disabled, deleted files on the virtual disk do not immediately free up the corresponding storage, leading to potential overuse of storage resources.

Here’s what happens when **Discard** is enabled:

* The system periodically identifies and frees unused disk blocks.
* **vSAN** storage remains optimized, as unused blocks are reclaimed.
* Disk space usage more accurately reflects the actual data stored on the VM.

***

{% hint style="warning" %}
**Only disable Discard for performance reasons**

Disabling **Discard** can lead to storage inefficiencies and should only be done for specific performance-related reasons. Always consult with **VergeOS Support** before disabling this feature.
{% endhint %}

## Why Use Disk Discard?

* **Efficient Storage Management**: When a file is deleted from a VM, the unused blocks are immediately flagged as free, allowing the **vSAN** to reuse that space for other data.
* **Improved Disk Performance**: Discard operations help maintain a clean and optimized storage system, reducing overhead from managing fragmented or unused blocks.
* **Space Reclamation**: Particularly in environments with high storage churn (i.e., frequent file creation and deletion), **Discard** ensures that space is consistently reclaimed, avoiding storage bloat.

## When to Disable Disk Discard

In rare circumstances, you may need to disable **Discard** to improve performance, particularly on certain workloads where the overhead of issuing TRIM/DISCARD commands may cause delays or slowdowns. Before making this change, it's critical to understand the trade-offs in terms of storage efficiency and consult with VergeOS Support for further guidance.

***

By keeping **Discard** enabled, you ensure that VergeOS optimizes storage for virtual machines, maintaining high efficiency and minimizing wasted space.

***

{% hint style="info" %}
**Document Information**

* Last Updated: 2024-08-29
* vergeOS Version: 4.12.6
  {% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vergeos-demo.com/knowledge-base/virtual-machines/vm-disk-discard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
