> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmk/solutions/persistent-volume-is-in-a-released-state-and-failing-to-mount.md).

# Persistent Volume is in a "released" State and Failing to Mount Within the Pod

## Problem

You deleted an existing *PersistentVolumeClaim* and are trying to mount the *PersistentVolume* to another *pod* but it is failing to mount. The volume is observed to be in a "**released**" state as seen below.

{% tabs %}
{% tab title="Javascript" %}

```javascript
kubectl get pv,pvc
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM               STORAGECLASS   REASON   AGE
pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51   4Gi        RWO            Retain           Released   default/old-claim   test-ebs                5m31s
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed Kubernetes - All Versions

## Cause

When the *PersistentVolumeClaim* is deleted, the *PersistentVolume* still exists and the volume is considered "**released**". But it is not yet available for another *claim* because the previous claimant's data remains on the volume.

## Resolution

1. Describe the *PersistentVolume* and check the *ClaimRef*. You will see that it is referring to the older *PersistentVolumeClaim* (`old-claim` in this case) that has already been deleted.

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl describe pv pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51
Name:              pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51
Labels:            topology.kubernetes.io/region=us-east-1
                   topology.kubernetes.io/zone=us-east-1a
Annotations:       kubernetes.io/createdby: aws-ebs-dynamic-provisioner
                   pv.kubernetes.io/bound-by-controller: yes
                   pv.kubernetes.io/provisioned-by: kubernetes.io/aws-ebs
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      test-ebs
Status:            Released
Claim:             default/old-claim
Reclaim Policy:    Retain
Access Modes:      RWO
VolumeMode:        Filesystem
Capacity:          4Gi
```

{% endtab %}
{% endtabs %}

2. Delete the old *ClaimRef* by running the following command.

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl patch pv pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51 -p '{"spec":{"claimRef": null}}'
persistentvolume/pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51 patched
```

{% endtab %}
{% endtabs %}

3. Describe the *PersistentVolume* again and validate that the *ClaimRef* has been reset.

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl describe pv pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51
Name:              pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51
Labels:            topology.kubernetes.io/region=us-east-1
                   topology.kubernetes.io/zone=us-east-1a
Annotations:       kubernetes.io/createdby: aws-ebs-dynamic-provisioner
                   pv.kubernetes.io/bound-by-controller: yes
                   pv.kubernetes.io/provisioned-by: kubernetes.io/aws-ebs
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      test-ebs
Status:            Available
Claim:
Reclaim Policy:    Retain
Access Modes:      RWO
VolumeMode:        Filesystem
Capacity:          4Gi
```

{% endtab %}
{% endtabs %}

4. Validate the status of the *PersistentVolume*.

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
pvc-37a9d4dc-2f24-403d-ad77-13a203d02c51   4Gi        RWO            Retain           Available           test-ebs                12m
```

{% endtab %}
{% endtabs %}

5. Now that the *PersistentVolume* is in an **Available** status, it can be mounted to any other pod.


---

# 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://platform9.com/kb/pmk/solutions/persistent-volume-is-in-a-released-state-and-failing-to-mount.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.
