# Delete lost primary shard

**URL:** <https://discuss.elastic.co/t/delete-lost-primary-shard/362888>\
**Category:** Elasticsearch\
**Created:** [July 10, 2024, 1:34pm UTC](https://discuss.elastic.co/t/delete-lost-primary-shard/362888 "2024-07-10T13:34:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALIT](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ALIT](https://discuss.elastic.co/u/ALIT)\
**Post date:** [July 10, 2024, 1:34pm UTC](https://discuss.elastic.co/t/delete-lost-primary-shard/362888/1 "2024-07-10T13:34:09Z")

</div>

Hi,

due to running out of disk space, I reduced number of replicas to 0 for a few indices. Of course during this time one node had a disk failure and I think the data is lost.  
Now the cluster is red because one index has a missing primary shard without replica shard. The index has 30 shards, so 29 are available, 1 is lost. Is there a way to somehow ignore the lost replica shard and bring back the cluster to green?  
I'm fine with losing the data from the lost shard. But it would be good to still have the other 29 shards.

Thank you!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 10, 2024, 1:53pm UTC](https://discuss.elastic.co/t/delete-lost-primary-shard/362888/2 "2024-07-10T13:53:28Z")

</div>

You can replace the lost primary with an empty shard using the `allocate_empty_primary` command in the reroute API: [Cluster reroute API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html)

---

<div class="post-metadata">

**Author:** ![ALIT](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ALIT](https://discuss.elastic.co/u/ALIT)\
**Post date:** [July 10, 2024, 2:05pm UTC](https://discuss.elastic.co/t/delete-lost-primary-shard/362888/3 "2024-07-10T14:05:52Z")

</div>

Thank you very much - worked like a charm.

Note to myself - never reduce replicas to 0 again.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 10, 2024, 3:45pm UTC](https://discuss.elastic.co/t/delete-lost-primary-shard/362888/4 "2024-07-10T15:45:46Z")

</div>

... and take snapshots!
