Alex Tech: post #148 — TG.ME

When creating Raspberry Pi SD card backups, the generated image file is usually the full size of the SD card, even if only a small amount of storage is actually used.

For example, an SD card with only 4GB of data may still produce a 32GB image file because empty space is included in the backup.

A useful solution for this is PiShrink.

PiShrink shrinks the Linux partition inside the image and removes unused space, significantly reducing the final image size without deleting data.

It can also be used on Windows through WSL (Windows Subsystem for Linux).

Basic workflow:

- Install WSL with Ubuntu
- Move the Raspberry Pi image into the Linux environment
- Clone PiShrink from GitHub:
git clone https://github.com/Drewsif/PiShrink.git

- Enter the project directory:
cd PiShrink

- Give execute permission to the script:
chmod +x pishrink.sh

- Run the script:
sudo ./pishrink.sh your_image.img

After processing, image sizes can be reduced dramatically depending on the amount of used space.

PiShrink is especially useful for Raspberry Pi backup, archive, and image distribution workflows.
GitHub
GitHub - Drewsif/PiShrink: Make your pi images smaller!
Make your pi images smaller! Contribute to Drewsif/PiShrink development by creating an account on GitHub.
⚡1❤‍🔥1🦄1
May 25, 2026 291