Page 1 of 1

ApplePi-Baker v2.1 Update – Faster and Expand or Shrink IMG

ApplePi-Baker v2.1 Update – Faster and Expand or Shrink IMG

I’m very excited to announce that ApplePi-Baker now supports shrinking and expanding of Ext2, Ext3 or Ext4 Linux partitions on a Mac!!
This is something I wasn’t able to do before and is commonly seen as a challenge on a Mac (since MacOS does not support these Linux File Systems).

This update can only shrink or expand Linux partitions on a MBR partitioned disks (very common format used for the Raspberry Pi).

Keep in mind: I’ve done quite a lot of successful tests, but by lack of beta testers, I’m still marking it as experimental.

During backup, if the option has been enabled, ApplePi-Baker will locate a Linux partition and if found shrink it to it’s minimal size, and update the IMG file and it’s partition table (the source will not be affected). This will result in a much more compact IMG file, and offers a restore to a device of a different capacity.

On Restore, this same option will expand that Linux partition to the maximum available size on the target disk.
Obviously, the target device needs to be able to accommodate at least the minimum size of the IMG file.

Since quite a bit needs to be done (find partition, check file system integrity, resize partition, etc), this will naturally slow down the backup and restore process, but it will help restoring to different sized target disks/SD-card.

Not only that, version 2.1.0 will be much faster than 2.0.0 – I’ve seen speed increases up to 300% during backup.

You can find the latest version of ApplePi-Baker in the original article (please place comments there).


Donation options

Donations are very much appreciated, but not required. Donations will be used for web-hosting expenses, project hardware or a motivational boost (a drink or snack). Thank you very much for those have donated already! It's truly AwEsOmE to see that folks like our articles and small applications.


There are 14 comments. You can read them below.
You can post your own comments by using the form below, or reply to existing comments by using the "Reply" button.

  • Jun 7, 2019 - 11:48 PM - Antonio Dávila Comment Link

    Hi, I downloaded v2.1.3 and selected the shrink option when making an IMG of my card, I get the proper “Shrink IMG Enabled” log informing me it is creating a *.tmp file, then after an hour or so of reading my 64gb card, I get the following error when the resize process starts after cloning completed:

    Resizing – Atempting IMG Shrinking

    RESIZE – Attempting to minimize a Linux partition in the in the IMG file “backup.tmp”

    RESIZE – ERROR: Source IMG File does not exist

    Resize Error – Source IMG File does not exist…

    and this I fail to get a proper .img backup..

    Any idea what I am doing wrong or need to modify? Attempted 3 times and all of them failed

    Thank you!


    Antonio Dávila

    • Jun 8, 2019 - 7:05 AM - hans - Author: Comment Link

      Hi Antonio,

      I’m sorry to hear you’re running into issues.
      Unfortunately, I didn’t have many beta testers, and to make things worse; I’m traveling .
      First thing I’d check is disk space, and if I recall correctly see if the directory ~/tmp was made.
      What is the build version you’re using? (look in the “About”, your can right click the version info to copy it to clipboard and paste it here)



      • Jun 10, 2019 - 10:33 AM - Antonio Comment Link

        Hi Hans! Thank you very much for your reply, let me check into the disk space issue, seems that could be the problem since I have a 512gb SSD Mac and I was taking the IMG from a 64gb card, will check about the /tmp folder too.

        Checked the build and its 2.1.3 build 98.

        Just discovered Apple Bi Baker a few days ago and I am in love with it, as soon as I can shrink the file I will be ecstatic to say the least =)

        Enjoy your trip, I will get back to you as soon as I am done making some experiments and find out what is causing the problem.





        • Jun 10, 2019 - 11:49 AM - hans - Author: Comment Link

          Thanks Antonio!

          Glad to hear you’re liking ApplePi-Baker.
          As for the resizing; I’m considering doing it in a different way, but that will take some work to get that done.

          Yeah I think being able to shrink  has almost become a requirement to have that when working with Raspberry Pi images and/or SD cards



  • Jun 10, 2019 - 12:46 PM - Antonio Davila Comment Link

    You know the IT adage/joke that says: have you tried restarting it? hahaha

    Well I turned of my computer for the weekend and came back to it this Monday morning, checked what you mentioned and decided to try it one more time with the shrink img option. Let it run for about an hour or so, went to pick some coffee, came back to my mac and… surprise!! There was a 4gb .img waiting for me.. much smaller than 64gb! 

    I immediately grabbed a 16gb ram SD card, tried to burn the 4gb .img file with balena etcher as I used to do with all raspbian images and… surprise! it is working perfectly!! I am so so so happy an excited for all things I will be able to accomplish now! 

    I clicked on the donate with Flattr but it did not provide any way to pay, only got to the “donate to” screen. Will find a way to make it work and make sure you receive my donation, ApplePi Baker is awesome!! really awesome! =)

    Thank you very very much Hans!




    Antonio Davila

    • Jun 10, 2019 - 12:53 PM - hans - Author: Comment Link


      Being active in IT myself; yeah, most users are not pleased when you tell them to do that hahaha.

      By the way; when you do a restore with APB, it can actually expand the 4Gb to fill the entire 16Gb card.
      I’d be happy to hear if the shrinking and expanding works well. It has been tested by myself, with success, but it would be great to hear confirmation from other.

      Oh and thanks for reminding me about Flattr. I still have to remove that.
      They are not paying out the money people donated, no matter what I try .

      PayPal is an option though: hans at luijten dot net.
      But … never a requirement. Sharing the link is just as great of a donation 



      • Jun 10, 2019 - 1:16 PM - hans - Author: Comment Link

        I carefully assume you’re in Mexico? 
        If so: thanks for the donation (it didn’t mention an email address).
        I most certainly will cash that in tonight for a few beers 



        • Jun 11, 2019 - 11:48 AM - Antonio Comment Link

          Yup! Monterrey, Mexico to be precise, so go and enjoy some Coronas!! (not our best beer but our most famous heh). 

          I am still making images to my heart’s content and backed up all my Pi’s ,thank you again!

          Sidenote beer fact: Monterrey is the beer capital of Mexico since 1890, (Corona is from the competitor made in Mexico City), Monterrey’s brewery building was modeled after Heineken’s brewery in Amsterdam which was state of the art back then. Nowadays the buildings are way more similar because they both feature Heineken signs since the Mexican and Dutch companies merged a few years back, who would have expected that? haha



        • Jun 12, 2019 - 11:44 AM - hans - Author: Comment Link

          Nice! I’ve never been to Mexico  – even though I have been “relatively” close (I used to live in Houston).
          Yeah Corona with a lime will be good on a sunny day.
          But it’s like Dutch beer; Heineken most certainly is not the best either .

          It is pretty cool though to have significant history in your backyard 
          My favorite beers are Belgian, and my favorite pilsners are German though.
          And my safe beer is Corona 

          What would be the best Mexican beer in your opinion? I wouldn’t mind trying to find some in the local store.



          • Jun 12, 2019 - 7:01 PM - Antonio Comment Link

            Yeah, Houston is “relatively” close to Mexico, but anyway it is still a five and a half hours drive to the border at Laredo, TX. 

            My fave Mexican beer would be Bohemia and a close second Indio. Funny thing, our own beers are getting harder to locate in convenience stores due to Dutch beer brands replacing them, at least since the Heineken-Cuauhtémoc Merger, now its easier to find Amstel and Heineken everywhere versus Carta Blanca and Indio. I guess its mostly due to marketing.

            Try to see if you can find out some Indio, Pacifico or Dos Equis, I like those too and they should be much easier to find over there I guess. 

            Now I gotta go and finish those Heinekens waiting for me in the fridge, cheers!! 


          • Jun 13, 2019 - 9:00 AM - hans - Author: Comment Link

            Haha, yeah relative indeed. But … I could have gone to Mexico – a 5.5 hour drive isn’t too bad.

            I’ll go check the local liquor store and see if I can find those brands!
            Marketing does seem to ruin everything, doesn’t it?

            Enjoy your Heinekens – cheers! 


        • Jun 12, 2019 - 11:45 AM - hans - Author: Comment Link

          p.s. I had a few Rolling Rock beers from your donation, sitting outside in the sun.
          Not world’s best beer either, but it won’t hit you over the head when sitting in the sun, and it drinks really easy .



      • Jun 10, 2019 - 1:37 PM - Antonio Davila Comment Link

        Just so you know, I flashed the card again with APB and yes, resizes the filesystem perfectly, thank you!




        Antonio Davila

        • Jun 11, 2019 - 8:41 AM - hans - Author: Comment Link


          If you run into issues, feel free to let me know here or email me.
          I’d be happy to help! 



Your Comment …

Friendly request to not post large files here (like source codes, log files or config files). Please use the Forum for that purpose.

Please share:
Notify me about new comments (email).
       You can also use your RSS reader to track comments.

Tweaking4All uses the free Gravatar service for Avatar display.
Tweaking4All will never share your email address with others.