Pishrink - shrink, restore to SD, then shrink again...?
-
Hi all, quick question about Pishrink.
Now I love this program, but I am curious - what if I shrink my image, restore it to a new SD card with Etcher, get it set back up in the Pi again, and then shrink that image all over again from scratch. Would that cause any issues or data loss or anything like that?
Asking because that's exactly what I'm trying to do now!
I have a very much beloved 64GB image I put together myself (I froze it about 4 months ago, never to update again until I get a new Pi). On my Linux Mint install I've used the dd command and took a snapshot (checking the integrity of the filesystem first of course). This created a like-for-like image, that I've now used Pishrink on, which gives me a 59GB image.
I then want to restore this to a new card, clean it up by removing save files, last played counts and whatnot to make it fresh. Then I want to dd it again and then re-Pishrink this image so that it's ready to be restored completely fresh when/if I ever need it.
Am I going to have any problems? Ta!
-
I expect the 2nd shrink would not yield significant gains, since the image would have only the necessary files.
If you want to 'clean-it' up further, I'd say it's easier to take a backup (usingdd
), then clean up the files you want and shrink the resulting image, restoring your original backup afterwards. -
I think my post was a little long, sorry! I'm not looking for any real gains beyond the manual clean up of space I'm doing. I'm more concerned with the integrity of the resulting image having been (kind of) Pishrunk again. What I am doing appears to have worked OK anyway (see below):
-
dd my original image to a .img file
-
Pishrink this
-
Then flash (using Etcher in this instance) to a new SD card
-
Bob back in Pi so it can restore itself
-
Success!
-
remove from Pi, put into PC and manually clean up save files etc. and settings to "fresh install" standard
-
approx. 3GB manually removed (my Kodi install was huge for example)
-
put back in PC and dd to new .img
-
then Pishrink this
I kinda answered my own question as it appears to have gone well. I was just worried whether or not I was introducing potential problems down the line doing this. Thanks for responding anyway. :-)
-
-
excuse for my english,Hi I have a problem that I can not solve .. until he loves hacking and passing evenings and evenings I have solved many problems on my bartop.la qeneration is this I downloaded a 400 gb image that promised total boot from usb with microsd disarmed (PLAYBOX is called). Well .. all ok what he promised was true, I had a 500 GB hard drive and instead of spending more than 100 euros for a 512 GB microsd I opted for the hard disk .. it all works I followed the procedure to expand with gparted the hard disk, I didn't expand everything until the end thinking of making a backup copy of another 500 gb hard disk, I set controller adjusted a bit of things .. here's the problem I can't get a backup on new hard disk or file to then transfer it to hard disk.
I tried everything both as a clone hard disk and as a backup of partitions (in fact it has 2 partitions, one in fat 32 and the other in ext4 (the one I expanded), I used win32 disk imager, acronis, all soft of easus, aomei, clonezilla, nothing .. some do not start right, but many seem to start with the flashing of the cursor as it is normal, but then the writing is not started with the loading of the S.O.
Possible solution? for have copy backup in new hard disk if original failure.... tankcs -
@archfranck we don’t support third party images, sorry
-
Never one to go around the hills, I guess what I was getting at was:
If I Pishrink my image and then restore it, can I then change some stuff again and re-Pishrink it safely?
Ta!
-
@Ranma Sure, there's no restriction on how many times you shrink an image.
-
@mitu
That's aces, thanks Mitu. I was just worried that there might be some jiggery-pokery going on behind the scenes, and if I kept doing this it could cause a problem I hadn't thought of.
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.