# Is it possible to completely delete file from the Cluster?

**URL:** <https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482>\
**Category:** Uncategorized\
**Created:** [December 18, 2018, 4:09pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482 "2018-12-18T16:09:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael-maverick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/michael-maverick/32/1603_2.png) [@michael-maverick](https://discuss.ipfs.tech/u/michael-maverick)\
**Post date:** [December 18, 2018, 4:09pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/1 "2018-12-18T16:09:19Z")

</div>

I have a Private IPFS Network and IPFS-CLuster.

I thought if I control all peers and just unpin some file by it’s CID from all peers than file will be deleted from the network. But I was wrong…

Using Cluster API :  
- added file (`ipfs-cluster-ctl add file.txt`)  
- check it status and it was pinned among all nodes (`ipfs-cluster-ctl status CID`)  
- unpinned recently added file (`ipfs-cluster-ctl pin rm CID`)  
- checked that it was unpinned (`ipfs-cluster-ctl pin ls`)

But I’m still able to get the file with `ipfs cat/get CID`…  
Even if I run garbage collector on all nodes `ipfs repo gc` I’m still able to access this file.

Is it possible to completely delete file from my Private Network/Cluster?

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [December 18, 2018, 4:38pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/2 "2018-12-18T16:38:56Z")

</div>

I’m guessing that you need to GC it and not just unpin it.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [December 18, 2018, 4:57pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/3 "2018-12-18T16:57:05Z")

</div>

> [@michael-maverick](#):
>
> Even if I run garbage collector on all nodes ipfs repo gc I’m still able to access this file.

That is weird. GCing should have removed it completely. Does `ipfs-cluster-ctl status CID` show it as unpinned? Does `ipfs pin ls <cid>` comes back empty in all ipfs peers?

You need to make sure that the file is not indirectly pinned by any other pin as well.

---

<div class="post-metadata">

**Author:** ![michael-maverick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/michael-maverick/32/1603_2.png) [@michael-maverick](https://discuss.ipfs.tech/u/michael-maverick)\
**Post date:** [December 18, 2018, 10:55pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/4 "2018-12-18T22:55:34Z")

</div>

> [@hector](#):
>
> You need to make sure that the file is not indirectly pinned by any other pin as well.

Hi Hector, can you please clarify what do you mean “indirectly”?

That’s what I have:

**Step 1** Node0  
Add file with `ipfs-cluster-ctl`

 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/d/dae14616a0627a9fd6dce1677c64d03954e56be5.jpg)

**Step 2** Node1  
Check status on the second node

 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/2/22328ee8c157b09bd99d79802fbaef9e1edd5cc8.jpg)

**Step3** Node1  
Cat file with `ipfs`  
 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/5/5befe115d0c49ee54667d47014d31deffa466b49.jpg)

**Step 4** Node0  
Remove/Unpin file with `ipfs-cluster-ctl`  
 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/a/abef9ad03b16bdc234c7b08e0ac82f154a545482.jpg)

**Step 5** Node0/Node1  
Cat file with `ipfs`  
 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/9/988c9e127e66b23bae3df3561fd1e1ec5376be6a.jpg)

**Step 6** Node0/Node1  
Run GC with `ipfs repo gc`

Node0

 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/f/f2fdc710109d227aa7d94ea09d85baf3230096f6.jpg)

Node1  
 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/5/539cb21624aeb6c09b0ad31d109030f9c46d7f4d.jpg)

**Step 7** Node0/Node1  
Cat file with `ipfs`

Node0

 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/6/661ebe78dc8e5ac24d999fbdd0c491113ccf447e.jpg)

Node1  
 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/0/0ea43987a0180dbbee94e39d61289874ab412ad5.jpg)

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [December 18, 2018, 11:36pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/5 "2018-12-18T23:36:32Z")

</div>

The problem is that garbage collection does not seem to be working on one of your peers, so the file is not garbage collected. You should investigate the gc error.

---

<div class="post-metadata">

**Author:** ![michael-maverick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/michael-maverick/32/1603_2.png) [@michael-maverick](https://discuss.ipfs.tech/u/michael-maverick)\
**Post date:** [December 18, 2018, 11:52pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/6 "2018-12-18T23:52:24Z")

</div>

Ok, I’ll do more tests and come back.

By the way, In order not to join each peer separately is it possible to run GC on all peers with IPFS-Cluster?

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [December 19, 2018, 11:55am UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/7 "2018-12-19T11:55:07Z")

</div>

> [@michael-maverick](#):
>
> is it possible to run GC on all peers with IPFS-Cluster?

No, but we could easily support it. Can you open an issue in the cluster repository?

---

<div class="post-metadata">

**Author:** ![michael-maverick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/michael-maverick/32/1603_2.png) [@michael-maverick](https://discuss.ipfs.tech/u/michael-maverick)\
**Post date:** [December 20, 2018, 9:55pm UTC](https://discuss.ipfs.tech/t/is-it-possible-to-completely-delete-file-from-the-cluster/4482/8 "2018-12-20T21:55:15Z")

</div>

Yes, It works.

I redeployed my network and was able to remove file with `ipfs-cluster-ctl pin rm CID` + `ipfs repo gc`

Also I opened an Issue regarding ability to run GC with IPFS-Cluster API

> <https://github.com/ipfs/ipfs-cluster/issues/628>

Thanks!
