> For the complete documentation index, see [llms.txt](https://blog.azagra.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.azagra.dev/raspberrypi/reducir-tamano-imagen-.img-de-un-backup-de-la-sd.md).

# Reducir tamaño imagen .img de un backup de la SD

Cuando hacemos un backup de la SD a un .img, pesan demasiado... pero podemos reducir el tamaño de la .img final\
\
Primero descargamos el script

```shell
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
```

Le damos permisos de ejecución

```shell
chmod a+x pishrink.sh
```

Y lanzamos el script, pasando como parametro el fichero de la imgen .img

```shell
 sudo ./pishrink.sh imagen_raspberry.img
```

Finalmente nos dejara el .img con menos peso, para restaurar ese .img a la SD podemos usar el [RaspberryPi Imager](https://www.raspberrypi.com/software/)

<figure><img src="https://1432118199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8OmP3fsuoPnoJAJysYDx%2Fuploads%2FGyjdhcKj5JsT7OxaW3x5%2Fimage.png?alt=media&amp;token=b23fe5f1-3ab0-476c-81ab-7afa157b3604" alt=""><figcaption></figcaption></figure>
