Raspberry Pi Shrinking image to fit on a smaller card
Raspberry Pi Shrinking image to fit on a smaller card
f=3&t=58
This was (is?!) a pain. I wanted to shrink my image to fit on a smaller, or even
same size card.
When I use Win32DiskImager to make an image it wouldnt write the same
image back to an SD card of the same size.
The upshot is that you have to shrink the filesize of the image slightly.
So....
This is a Linux "live" CD, so when you write the ISO to a CD and boot from it, it
gives you a virtual linux environment to run gparted in.
I ran it in safe mode as it had a wobbly with drivers otherwise for me.
When in gparted, make sure you select the device that is the SD card (should
be easy to tell by overall size shown).
Resize your main (largest) partition by clicking on it and dragging the bar left
to free up some space.
This smaller size is what we will resize the image to. Remember to click Apply
to make the change to the card.
If this produces an error, try reducing the partition less (so leave less in the
unpartitioned area).
1 of 4 18-09-2021, 19:48
Raspberry Pi: Shrinking image to fit on a smaller card - Smart Retro Forums http://smartretro.co.uk/forums/viewtopic.php?f=3&t=58
You could do this next part in Linux (see end of post for details), but because I
use windows I do this:
2) Download Cygwin
https://www.cygwin.com/
2 of 4 18-09-2021, 19:48
Raspberry Pi: Shrinking image to fit on a smaller card - Smart Retro Forums http://smartretro.co.uk/forums/viewtopic.php?f=3&t=58
29835263 + 1 = 29835264
Multiply this by the sector size (512) = 29835264 * 512 = 15275655168
This then produces a smaller image filesize without overwriting a live partition.
Then when you write that image back to an SD card and boot it, make sure to
run raspi-config and extend the filesystem again.
If you want to do this in Linux there is an auto script that does it for you here:
http://sirlagz.net/2013/03/10/script-au ... downsizer/
Hi Floob,
i have used your manual to resize the image from my 32GB sd card.
only after the truncate when i have written the new image to an other card it
didnt work(the rpi didnt boot).
stil working on finding out what i did wrong.
3 of 4 18-09-2021, 19:48
Raspberry Pi: Shrinking image to fit on a smaller card - Smart Retro Forums http://smartretro.co.uk/forums/viewtopic.php?f=3&t=58
evilalex wrote:
Hi Floob,
Can you be more specific here? Is it just called Ghost, or in a suite of some
kind? Do you know the version number? What's the file extension of the images
it makes, or does it give you options on that?
TIA!
3 posts • Page 1 of 1
Post Reply
Home ‹ Board index Contact us Delete cookies All times are UTC
4 of 4 18-09-2021, 19:48