# Shrinking backup image

**URL:** https://dietpi.com/forum/t/shrinking-backup-image/6338
**Category:** General Discussion
**Created:** [17 February 2022 07:13 UTC](https://dietpi.com/forum/t/shrinking-backup-image/6338 "2022-02-17T07:13:19Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [17 February 2022 13:12 UTC](https://dietpi.com/forum/t/shrinking-backup-image/6338/4 "2022-02-17T13:12:11Z")

</div>

You should be able to generate a compressed DietPi image via the dietpi-imager script. This script is located in the .meta subdirectory in the GitHub DietPi share or can be executed via:

```nohighlight
bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager')"

```

But this would require to have the SD card placed as USB connected device on another Linux box. It will not work on a running system as the script is simply not designed for this.

To get the partition resized on first boot, you would need to activate dietpi-fs\_partition\_resize.service before creating the image.

---

_[View the full topic](https://dietpi.com/forum/t/shrinking-backup-image/6338)._
