1

I have a Raspberry Pi distribution on a bootable 32 GB SD card. What I would like to do, is the following:

  1. Shrink the partition to 4 GB (that's the size of the data on the card).

  2. Create an .img file from that SD card, so I can use it to create other bootable SD cards

Any ideas? A newbie here.

EastsideDev
  • 113
  • 1
  • 4

4 Answers4

1

This question, or variants, has been asked dozens of times on this site.

Basically, what you ask is not possible. (Actually it can be done, but requires a Linux computer and some expertise.)

If you want to create a backup image just compress it.

If you want to copy to a smaller SD Card use the SD Card Copier in Raspbian, or the piclone command line option.

See https://raspberrypi.stackexchange.com/a/93316/8697

Milliways
  • 59,890
  • 31
  • 101
  • 209
0

There are some possibilities to shrink a partition but you may consider to create a complete new image file and copy your old installation to it. This way you are free to configure your new image as you like. You can modify the size of all partitions so just make the root partition 4 GB before copying.

If you have made the image file you can just flash it to SD Cards as usual.

Look at How to make an image file from scratch.

Ingo
  • 42,107
  • 20
  • 85
  • 197
0

I suggest to use pishrink. This will shrink the partition to it's minimum, reduce the image size and create a minimal image.

framp
  • 910
  • 7
  • 17
0

A little late to the gate, but anyway. I have had real good success in creating a backup image for my Pi using USB Image Tool 1.70, and then using balenaEtcher to burn the image to another SD Card. The reason I dont use the USB Image Tool to write the image is because in Win10 anyway, that wont work with the software. I cant run WinImage on Win10, so this way works well for me. 1.8 is here, I havent tried it yet: https://www.techspot.com/downloads/6355-usb-image-tool.html

Nothoro
  • 11
  • 2