# Task "Compact Blob Store" does not reclaim disk space

**URL:** <https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058>\
**Category:** Sonatype Nexus Repository\
**Created:** [February 3, 2023, 2:17pm UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058 "2023-02-03T14:17:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stenbek](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@stenbek](https://community.sonatype.com/u/stenbek)\
**Post date:** [February 3, 2023, 2:17pm UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/1 "2023-02-03T14:17:10Z")

</div>

We have a large maven-snapshots repository with over 3 TB of reclaimable bytes, but nothing is deleted from disk when we run the “Compact blob store” task.

Output from the nx-blob-repo-space-report script ([https://support.sonatype.com/hc/en-us/article\_attachments/6138506837267/nx-blob-repo-space-report-20220510.groovy](https://support.sonatype.com/hc/en-us/article_attachments/6138506837267/nx-blob-repo-space-report-20220510.groovy)):

```auto
"maven-snapshots": {
	"reclaimableBytes": 3381780825366,
	"totalBytes": 3464385015422
}

```

Task log:

```auto
2023-02-03 14:55:21,685+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - Task information:
2023-02-03 14:55:21,688+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - ID: e39ab0a2-cd8d-4594-b21a-bedbe47b00b1
2023-02-03 14:55:21,688+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - Type: blobstore.compact
2023-02-03 14:55:21,688+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - Name: Compact blob store (delete artifacts from disk)
2023-02-03 14:55:21,688+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - Description: Compacting default blob store
2023-02-03 14:55:21,688+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - Begin deleted blobs processing
2023-02-03 14:55:34,998+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - Removed 0 empty directories from /nexus-data/blobs/default/content/directpath
2023-02-03 14:55:34,999+0100 INFO [quartz-11-thread-19] *SYSTEM org.sonatype.nexus.blobstore.compact.internal.CompactBlobStoreTask - Task complete

```

Any known causes for the task to not find these artifacts? Are there other ways of reclaiming bytes than running the “Compact blob store” task?

Thanks in advance!  
Best regards,  
Marius

---

<div class="post-metadata">

**Author:** ![paul.chown](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@paul.chown](https://community.sonatype.com/u/paul.chown)\
**Post date:** [November 15, 2023, 11:30am UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/2 "2023-11-15T11:30:11Z")

</div>

I have this problem too… I made a copy of the server and deleted every repository that references that blob store. Even when there are no references (the blob store could be deleted) the compact blob store tasks recovers nothing and the blob store stays with 165000 blobs and 740GB storage. This is going to be a big problem if it doesn’t recover unused space … we can’t just keep adding disk endlessly.

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [November 15, 2023, 8:35pm UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/3 "2023-11-15T20:35:54Z")

</div>

Try this fix: [https://support.sonatype.com/hc/en-us/articles/360025325653-How-to-rebuild-the-Admin-Compact-blobstore-deletions-index-file-if-soft-deleted-blobs-are-orphaned](https://support.sonatype.com/hc/en-us/articles/360025325653-How-to-rebuild-the-Admin-Compact-blobstore-deletions-index-file-if-soft-deleted-blobs-are-orphaned)

---

<div class="post-metadata">

**Author:** ![stenbek](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@stenbek](https://community.sonatype.com/u/stenbek)\
**Post date:** [November 16, 2023, 10:59am UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/4 "2023-11-16T10:59:03Z")

</div>

Thank you Rich. The solution described in the link worked like charm:

* * *

Locate the **file based** blobstore containing the soft-deleted blobs which were not deleted by the Admin - Compact blobstore task.

Add the following line to the **metadata.properties** file in the root directory of the blobstore.

**rebuildDeletedBlobIndex=true**

For example, the _default_ file based blobstore metadata properties file is relative to the install dir at …/sonatype-work/nexus3/blobs/default/metadata.properties

The next time that the Admin - Compact Blobstore task is run, it will iterate over all of the properties files in the blobstore, looking for the **deleted=true** attribute and rebuild the index file.

* * *

---

<div class="post-metadata">

**Author:** ![paul.chown](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@paul.chown](https://community.sonatype.com/u/paul.chown)\
**Post date:** [November 16, 2023, 11:58am UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/5 "2023-11-16T11:58:57Z")

</div>

Thanks Rich, yes, that also worked for me. I have the feeling that the problem is caused by the Maven cleanup tasks that we use to remove snapshots after 30 days.

Shouldn’t this cleanup mode be the default “compact blob store” task behaviour if the standard cleanup is missing large chunks of storage? Or at least an additional option? Having to manually intervene in the filesystem isn’t ideal for such a fundamental cleanup action.

---

<div class="post-metadata">

**Author:** ![Lindsey\_Blackstock1](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/lindsey_blackstock1/32/3878_2.png) [@Lindsey\_Blackstock1](https://community.sonatype.com/u/Lindsey_Blackstock1)\
**Post date:** [July 17, 2025, 3:23pm UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/6 "2025-07-17T15:23:55Z")

</div>

Sorry to resurrect an old post, but I am facing this problem with the blobstore used for docker images. I have followed all the steps (cleanup/compact), restarted nexus, ran a repair - recalculate blob store size, but still the blob store is running out of space (~50GB free). Is there anything else to try?

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [July 17, 2025, 3:50pm UTC](https://community.sonatype.com/t/task-compact-blob-store-does-not-reclaim-disk-space/10058/7 "2025-07-17T15:50:34Z")

</div>

Have you checked out the cleanup page on the help site - [Cleanup Policies](https://help.sonatype.com/en/cleanup-policies.html#docker-cleanup-strategies)

There are additional steps you may need to take to ensure unreferenced layers are removed.
