Build Your Own Arcade Controls Forum

Main => Raspberry Pi & Dev Board => Topic started by: jdbailey1206 on November 13, 2017, 07:57:07 pm

Title: Shrinking Pi Image
Post by: jdbailey1206 on November 13, 2017, 07:57:07 pm
Does anybody have a good step by step process on how to shrink a Pi Image.  I am trying to back up a Pi image on a new SD card.  But I am .09 GB from being too small.  Hook a brotha up.
Title: Re: Shrinking Pi Image
Post by: yotsuya on November 13, 2017, 08:25:25 pm
Does anybody have a good step by step process on how to shrink a Pi Image.  I am trying to back up a Pi image on a new SD card.  But I am .09 GB from being too small.  Hook a brotha up.

Shrink a Pie? Slice by slice.
Title: Re: Shrinking Pi Image
Post by: jdbailey1206 on November 13, 2017, 08:57:57 pm
Remember when you said I was cool?  Now I know what you mean.  I think I have found a work around.  I just used the next step up for a micro sd card.  Went from 32 to 64GB.
Title: Re: Shrinking Pi Image
Post by: yotsuya on November 13, 2017, 09:07:32 pm
Remember when you said I was cool?  Now I know what you mean.  I think I have found a work around.  I just used the next step up for a micro sd card.  Went from 32 to 64GB.

(https://uploads.tapatalk-cdn.com/20171114/969f21750065de7ff42c6a7a9d89a8a5.jpg)

Right on, my man!
Title: Re: Shrinking Pi Image
Post by: pbj on November 13, 2017, 11:34:30 pm
Yes, there is a program called pishrink that can do this.  You must run it in linux.  I used a small pi image to boot up to a command prompt, and shrank the image stored on an external usb drive.

It ran for literally two days, but knocked about 10 gigs of a 128gb image that was like 200mb too large.

Title: Re: Shrinking Pi Image
Post by: Osirus23 on November 14, 2017, 10:29:07 am

It ran for literally two days, but knocked about 10 gigs of a 128gb image that was like 200mb too large.

Eh, I'd just buy a bigger card.
Title: Re: Shrinking Pi Image
Post by: pbj on November 14, 2017, 11:39:53 am
Well, I had already spent $60 on the card.  I didn't want to roll the dice again.  But whatever, bro.

 :cheers:
Title: Re: Shrinking Pi Image
Post by: jdbailey1206 on November 14, 2017, 08:07:32 pm
Right on, my man!

(https://i.pinimg.com/originals/f1/2c/63/f12c6358cee4d06abaa42259f8c74562.gif)

Eh, I'd just buy a bigger card.

I made it easy on myself and just did this.  The price difference between a 32 and 64 GB Micro SD card is only ten dollars.  Its just frustrating to want to back up my image and the two 32 GB cards are different by .09 GBs.  And of course the one I wanted to copy over was bigger than the new one and not the other way around. 

Yes, there is a program called pishrink that can do this.  You must run it in linux.  I used a small pi image to boot up to a command prompt, and shrank the image stored on an external usb drive.

It ran for literally two days, but knocked about 10 gigs of a 128gb image that was like 200mb too large.



I don't have a Linux machine.  I tried to use GParted on the Pi but it didnt cooperate.  It was going to be too much work for something that was supposed to be quick and fun.
Title: Re: Shrinking Pi Image
Post by: floob on December 03, 2017, 08:12:24 am
One option here:
http://smartretro.co.uk/forums/viewtopic.php?f=3&t=58 (http://smartretro.co.uk/forums/viewtopic.php?f=3&t=58)

This uses a gparted live CD so the partition isnt mounted.
Title: Re: Shrinking Pi Image
Post by: nitrogen_widget on December 04, 2017, 06:42:44 am
Can't use gparted on a mounted partition.
download a live linux distro like mint or lubuntu and run gparted on the sdcard after backing it up just in case.
Title: Re: Shrinking Pi Image
Post by: johnm on December 04, 2017, 07:56:23 am


I had much the same problem with an image I grabbed, the guy had removed all copyrighted material but did not reduce the image size. I stuck pishrink.sh in the same directory and ran it under linux
Title: Re: Shrinking Pi Image
Post by: Grasshopper on December 05, 2017, 03:33:05 pm
I've used pishrink.sh a couple of times on 32GB cards, and it worked just fine.

From memory, it only took a few hours to run, although I didn't actually time it. The trick is to run it on a reasonably fast PC running Linux instead of the Pi itself.
Title: Re: Shrinking Pi Image
Post by: pbj on December 05, 2017, 04:04:09 pm
Yes, I ran it literally the slowest possible way, but it was idiot proof and got the result I needed.

Title: Re: Shrinking Pi Image
Post by: nitrogen_widget on December 05, 2017, 10:17:57 pm
I've used pishrink.sh a couple of times on 32GB cards, and it worked just fine.

From memory, it only took a few hours to run, although I didn't actually time it. The trick is to run it on a reasonably fast PC running Linux instead of the Pi itself.

this is marvelous.
used my laptop to shrink the image by 4gb in 10 min.