PiShrink – Make Raspberry Pi Images Smaller

Raspberry Pi requires no introduction. It is a small, affordable and credit-card sized computer that can be connected to a Monitor or TV. We can attach a standard keyboard and mouse and use it as a full-blown desktop computer to do everyday tasks, such Internet browsing, playing videos/games, word processing and spreadsheet making and a lot more. It has been mainly developed for teaching Computer science in schools. Nowadays, Raspberry Pi is widely being used in colleges, small-medium organizations and institutes to teach coding. If you own a Raspberry Pi device, you might want to check out a bash script named “PiShrink”, which is used to make Raspberry Pi Images smaller. PiShrink will automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better. This can be useful to fit the large size images in your SD card. In this brief guide, we are going to learn to shrink Raspberry images to smaller size in Unix-like systems.

Installing PiShrink

To install PiShrink on your Linux box, first download the latest version using command:

Make Raspberry Pi Images Smaller

As you may already know, Raspbian is the official operating system for all models of Raspberry Pi. The Raspberry foundation has developed Raspberry Pi Desktop version for PC and Mac. You can create a live cd, run it in virtual machine and even install it in your desktop as well. There are also few unofficial OS images available for Raspberry Pi. For the purpose of testing, I’ve downloaded the official Raspbian OS from the official download page.

Unzip the downloaded OS image:

$ unzip 2019-04-08-raspbian-stretch-lite.zip

The above command will extract contents of 2019-04-08-raspbian-stretch-lite.zip file in the current working directory.