# 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="/files/3kqf5LXCw0TyjDV48eUJ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.azagra.dev/raspberrypi/reducir-tamano-imagen-.img-de-un-backup-de-la-sd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
