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.

  • Search for resizing Linux partitions.
    – joan
    Jun 24, 2022 at 16:59
  • If you search this site you will find a few examples of programs to create a small image of a Pi OS which can be used to make a new smaller image.
    – Milliways
    Jun 24, 2022 at 23:12
  • @Milliways I havent found such programs but found some scripts and tutorials, not as simple as SD Card Copier (updated the question).
    – ramiwi
    Jun 25, 2022 at 18:28
  • 1
    @ramiwi you seem to have found some - including mine. I don't know WHY you think these aren't programs. NOTE SD Card Copier is NOT fail-safe; ANY program which operates on an active image has some risk - this can be minimised by running on an system with minimal activity.
    – Milliways
    Jun 26, 2022 at 1:56
  • 1
    NOTE most use rsync in the background (including Ron's). SD Card Copier does something similar as it implements file by file copy. You can also use gparted etc to modify images, but this properly refuses to modify an active partition.
    – Milliways
    Jun 26, 2022 at 2:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.