The builtin SD Card Copier tool can create copies smaller than the system sd card, so it can be used for cloning the system into smaller cards. Is there a similar tool (running on any os) for creating small image files from an rpi system sd card?
As far as I understand dd and bkup_rpimage are copying the full system drive. There is an option to compress it after dumping but it will still require the same size target sd card when restoring.
UPDATE: I found RonR-RPi-image-utils (more than 1 version) and PiShrink scripts that should be able to do this. Others suggested using rsync. So far I have tested PiShrink on an image created by Win32DiskImager and it seems to work well.
I wonder if the shrunk images produced by those methods are fail-safe as the SD Card Copier results.
rsync
in the background (including Ron's). SD Card Copier does something similar as it implements file by file copy. You can also usegparted
etc to modify images, but this properly refuses to modify an active partition. – Milliways Jun 26 '22 at 02:02