gparted knows about a large number of different filing systems and the tools required to do operations such as check and resize them.
I don't bother shrinking the backup partition files, the current nightly backup is stored uncompressed and I make compressed weekly and monthly copies.
The trick being is to use the zerofree tool on the image file, to zero all the free space, then when you gzip that compresses away to nothing. It will be the same size as if you shrank the image then compressed it, but with the advantage unzipping will expand it back to the original image size.
zerofree is also a lot faster than shuffling data when you shrink an image. Use pigz to compress and it will use all cores to zip it, far quicker than gzip. Finally you can gunzip -c the compressed image and pipe it in to a dd command writing straight to an SD card.
---druck