Help shrinking SD backup image?
-
Hey all, so I made a pretty silly mistake I'm trying to rectify.
I backed up my 512gb SD card from my retropie so I could use it with my phone instead, as I was going to begin using my 512gb m.2 for the retropie.
The mistake is, my m.2 SSD is 500gb,not 512gb. So now I've got an SSD thats too small, and I've already formated the SD card, which is now in my phone.
I've been googling for a few days with no luck and hoping someone on here may have any ideas on how to rectify it, as I spent months tinkering, making the build just right.
Any help would be greatly appreciated. -
How exactly did you backup the card?
-
@clyde I used Win32DiskImager to create the backup. I just followed a youtube tutorial and it seemed to work.
-
There's PiShrink that can shrink an existing backup image, but you'll need a Linux installation to perform run it - most likely - double the space of your image to accommodate the source/new images.
Otherwise, you can use 7zip to open the image and read the files, then transfer them to your Pi over file shares. It will be slow, but you don't need a Linux install.
-
I haven't used it, but there is a tool called rpi-clone that will clone your RPi system to an SSD or SD card. If I were in your shoes, I would:
Take the card out of the phone and back it up.
Write the backed-up RetroPie image back to the card and put it back in the Pi.
Clone the Pi to the SSD using
rpi-clone
.Remove the card and make sure Pi can boot from the SSD.
Write the backed-up phone image back to the card and put it back in the phone.
-
@mitu said in Help shrinking SD backup image?:
There's PiShrink that can shrink an existing backup image, but you'll need a Linux installation to perform run it
… or a live system running from a usb drive like these five or Ubuntu itself, I guess? I only skipped over PiShrinks code, but I didn't see anything that seemed to require an actual installation.
That said, does PiShrink run on RetroPie? Then @omegafeggy could just install a fresh RetroPie on the SSD and then extract the backup image's contents needed from within the new system. Would that be feasible?
-
@mitu perfect thank you. I wouldn't have double the space of the image, as I'm only using a 1tb internal SSD on my computer, but putting a fresh retropie installation on the 500gb SSD then copying the files over might work. It will take a while to transfer, but it's so much better than making the build from scratch again lol
-
@sleve_mcdichael Will rpi-clone let me clone the build to the SSD as there's a 12GB difference? I think there was about 8GB free on the SD, and I would happily delete more if it ment getting my build back lol If so that should work perfectly.
-
@omegafeggy I mean, you'll have to delete a few more GBs to make it fit but yeah, I think the point of the tool is that it doesn't also copy the unused space like a full disk image does, so you only need as much free space as is actually used. But like I said, I've not used it myself so this is just a guess really.
-
@sleve_mcdichael sorry yeah that's what I meant to ask but didn't word it properly lol I'll try this today and see how it goes, and I've no problem shaving a few GB off if it means saving my build lol
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.