0

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.

  • Look for piclone – Jaromanda X Jun 27 at 22:54
  • you adked a question that has a yes/no answer – jsotola Jun 28 at 0:27
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.

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.