# Reclaim storage space when deleting a large dataset in hdf5 file

**URL:** <https://forum.hdfgroup.org/t/reclaim-storage-space-when-deleting-a-large-dataset-in-hdf5-file/4626>\
**Category:** HDF5 Library\
**Created:** [July 18, 2018, 2:10pm UTC](https://forum.hdfgroup.org/t/reclaim-storage-space-when-deleting-a-large-dataset-in-hdf5-file/4626 "2018-07-18T14:10:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpsinfotech](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@jpsinfotech](https://forum.hdfgroup.org/u/jpsinfotech)\
**Post date:** [July 18, 2018, 2:10pm UTC](https://forum.hdfgroup.org/t/reclaim-storage-space-when-deleting-a-large-dataset-in-hdf5-file/4626/1 "2018-07-18T14:10:41Z")

</div>

Is there anyway to reclaim the storage space when deleting a large datasets in HDF5 file.

I have read the file space management strategy in HDF5 but when i tried it didn’t worked. Can you please help me?

---

<div class="post-metadata">

**Author:** ![bljones](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@bljones](https://forum.hdfgroup.org/u/bljones)\
**Post date:** [July 18, 2018, 3:33pm UTC](https://forum.hdfgroup.org/t/reclaim-storage-space-when-deleting-a-large-dataset-in-hdf5-file/4626/2 "2018-07-18T15:33:49Z")

</div>

You can use h5repack to get rid of unused space in a file. h5repack is a command-line tool that comes with the binary distribution of HDF5. This page shows some of the things you can change in a file with the command-line tools:

[https://portal.hdfgroup.org/display/HDF5/Command-Line+Tools+for+Editing+HDF5+Files](https://portal.hdfgroup.org/display/HDF5/Command-Line+Tools+for+Editing+HDF5+Files)

---

<div class="post-metadata">

**Author:** ![jpsinfotech](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@jpsinfotech](https://forum.hdfgroup.org/u/jpsinfotech)\
**Post date:** [July 18, 2018, 6:11pm UTC](https://forum.hdfgroup.org/t/reclaim-storage-space-when-deleting-a-large-dataset-in-hdf5-file/4626/3 "2018-07-18T18:11:43Z")

</div>

Thanks bljones… But H5Repack utility is taking more time when I execute it. It depends on the file size. I believe It reads and writes it into a new file. Is there any default behaviour in HDF5, like if i delete a dataset in H5 file, it should automatically release the storage.
