# How to delete \`local\` PV automatically, keeping files

**URL:** https://discuss.kubernetes.io/t/how-to-delete-local-pv-automatically-keeping-files/31000
**Category:** General Discussions
**Created:** [January 2, 2025, 1:28am UTC](https://discuss.kubernetes.io/t/how-to-delete-local-pv-automatically-keeping-files/31000 "2025-01-02T01:28:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![PerformantData](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/performantdata/32/15662_2.png) [@PerformantData](https://discuss.kubernetes.io/u/PerformantData)
#### Post date: [January 2, 2025, 1:28am UTC](https://discuss.kubernetes.io/t/how-to-delete-local-pv-automatically-keeping-files/31000/1 "2025-01-02T01:28:46Z")

</div>

I created a `local` PersistentVolume.

When I set `persistentVolumeReclaimPolicy: Retain`, the PV hangs around until I `kubectl delete` it. I don’t want to have to do that: I want the PV to delete itself when it’s released. I’ll re-create it for the next pod that needs it, maybe as part of my Helm chart.

When I set `persistentVolumeReclaimPolicy: Delete`, it fails to delete, reason `VolumeFailedDelete` from `persistentvolume-controller`, message

```auto
error getting deleter volume plugin for volume "…": no volume plugin matched

```

I take this to mean that a `local` volume doesn’t know how to delete itself. I’d like the deletion to leave any files in place and just delete the PV.

Can I set up a nilpotent deleter for this PV/StorageClass?

### Cluster information:

Kubernetes version: 1.32  
Cloud being used: bare-metal  
Host OS: Linux  
CRI and version: CRI-O 1.32

---

<div class="post-metadata">

### Author: ![PerformantData](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/performantdata/32/15662_2.png) [@PerformantData](https://discuss.kubernetes.io/u/PerformantData)
#### Post date: [January 2, 2025, 1:48am UTC](https://discuss.kubernetes.io/t/how-to-delete-local-pv-automatically-keeping-files/31000/2 "2025-01-02T01:48:20Z")

</div>

same as

> [@【Help】Questions about local data volumes and Reclaim Policy: Delete](https://discuss.kubernetes.io/t/help-questions-about-local-data-volumes-and-reclaim-policy-delete/30758):
>
> Environment: Kubernetes master: 192.168.174.110 Kubernetes work-node-01: 192.168.174.125 Kubernetes work-node-02: 192.168.174.126 Kubernetes version: v1.31.3 Installation method: kubeadm init Host OS: Ubuntu 22.04 LTS CNI and version: calico v3.29.0 CRI and version: containerd://2.0.0 My custom storageclass.yaml file contents apiVersion: [storage.k8s.io/v1](http://storage.k8s.io/v1) kind: StorageClass metadata: name: local-storage annotations: [storageclass.kubernetes.io/is-default-class:](http://storageclass.kubernetes.io/is-default-class:) “true” provisioner: [kubernetes.io/no-provisioner](http://kubernetes.io/no-provisioner) volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete My cus…
