【Raspberry Pi】Compression of Raspberry Pi image

This article mainly records how to compress the Raspberry Pi image.

Recently, there is a very strange problem when burning the image of Raspberry Pi 4B. No matter how the 32G SD card is formatted, it is slightly larger than the backup image of Raspberry Pi 4B. According to theory, it should be It can be burned in, but during the burning process, it is repeatedly reminded that the SD card has insufficient space and cannot be burned.

In fact, when backing up the Raspberry Pi image, a large part of it has no data space, so you can use the following tool pishrink to compress the image!

Note: The following needs to be run in a Linux environment!

1. Get the pishrink tool

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

2. Grant permissions

sudo chmod 777 pishrink.sh  

3. Start compression (followed by the added image path)

sudo bash pishrink.sh ROS1-melodic-RaspberryPi-sdcard-5.6-20230525.img

We can see that the image of more than 30G was compressed to 21G in the end, which is very nice! In this way, we can burn the image to our SD card normally!

Guess you like

Origin blog.csdn.net/qq_42108414/article/details/131100465