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
   32

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 is 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.

Comments


There are 32 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!

    Reply

    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)

      Reply

      hans

      • 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.

        Regards

        Antonio

        Reply

        Antonio

        • 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

          Reply

          hans

  • 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!

    Regards

    Antonio

    Reply

    Antonio Davila

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

      Awesome! 

      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 

      Reply

      hans

      • 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 

        Reply

        hans

        • 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

          Reply

          Antonio

        • 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.

          Reply

          hans

          • 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!! 

            Antonio

          • 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! 

            hans

        • 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 .

          Reply

          hans

      • 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!

        Regards

        Antonio

        Reply

        Antonio Davila

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

          Awesome! 

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

          Reply

          hans

  • Jun 25, 2019 - 5:56 AM - Sandra Comment Link

    I just installed to empty card NOOBS_v3_1_1 which is based on Debian “buster” and then tried to backup it using ApplePi Baker 2.1.0 (91), Helper tool 1.4b in 10.14.4.

    I got this error:

    13:08:47  No HelperTool Found - Installing HelperTool
    13:09:06 HelperTool Updated to 1.4b
    13:09:10 Drive added to list: /dev/disk3 (31 GB SanDisk SDDR-199)
    13:09:12 -- START BACKUP
    13:10:10 Disk Appeared - /dev/disk4
    13:10:15 Details Updated - Partition /dev/disk4s2
    13:11:20 -- START BACKUP
    13:11:49 Backup Started - Making Disk to File Backup
    13:11:49 Source - Disk: /dev/disk3 (31 GB SanDisk SDDR-199) (30,777,802,752 bytes)
    13:11:49 Destination - File: /Volumes/Backup/Raspberry/Raspberry.img
    13:11:49 Shrink IMG Enabled - Temporary IMG file: "Raspberry.tmp"
    13:11:50 Backup started
    13:39:22 Completed - Cloning Completed
    13:39:22 Finished - Completed in 27 minutes and 33 seconds, average speed 18.7 MB/sec
    13:39:22 Resizing - Attempting IMG shrinking
    13:39:23 RESIZE - Attempting to MINIMIZE a Linux partition in the IMG file “Raspberry.tmp"
    13:39:23 RESIZE - Find Ext2/3/4 partition and determine size and location
    13:39:23 RESIZE - ERROR: No Linux partitions found
    13:39:23 Resize Error - No Linux partitions found
    Reply

    Sandra

    • Jun 25, 2019 - 8:45 AM - hans - Author: Comment Link

      Hi Sandra,

      thank you for reporting this.
      Could it be that your disk is full? (also check ~/tmp)

      I seem to have to improve some error handling, which I’ll get to when I get back from vacation. 

      Reply

      hans

      • Jun 25, 2019 - 8:55 AM - Sandra Comment Link

        End result is Raspberry.tmp which is 30.78GB.

        There is 2TB free in disk. I tried to find any other big files in disk but did not find anything.

        Is it possible to rename this file to .iso?

        Note that this latest Raspbian is buster version, which is alot different than previous one so i think this causes it.

        Reply

        Sandra

      • Jun 25, 2019 - 9:08 AM - hans - Author: Comment Link

        OK, thanks for getting back with that. So this is a bug I should look into (thanks again for reporting!).

        If I recall correctly, you can rename the file to a .IMG file (eg. Raspberry.img).

        Reply

        hans

        • Jun 25, 2019 - 10:50 AM - Sandra Comment Link

          I renamed it and still fails:

          18:42:44  Found Correct HelperTool version (1.4b)
          18:42:48 Drive added to list: /dev/disk3 (31 GB SanDisk SDDR-199)
          18:43:07 -- START RESTORE
          18:43:07 Restore Started - Restoring File to Disk
          18:43:07 Destination - /dev/disk3 (31 GB SanDisk SDDR-199)
          18:43:07 Disk Presence Check - Selected Disk Found
          18:43:07 Source - File: /Volumes/Backup/Raspberry/Raspberry.img
          18:43:07 Source - Trying to determine source size
          18:43:07 Source - Source is a Raw File
          18:43:07 Source - Size = 30,777,802,751 bytes
          18:43:07 Destination - Verifying Disk Capacity
          18:43:07 Destination - Max disk capacity is 30,777,802,752 bytes
          18:43:07 Disk Size Check - Capacity of Selected Disk PASSED
          18:43:07 Unmounting - Attempting Unmount of all Partition(s) of selected Disk
          18:43:07 Trying to unmount /dev/disk3
          18:43:07 UnMount - Waiting for unmount co complete
          18:43:07 Waiting for unmount to complete.
          18:43:08 Waiting for unmount to complete.
          18:43:08 Partition Unmounted - /dev/disk3s1
          18:43:08 Waiting for unmount to complete.
          18:43:09 Partition Unmounted - /dev/disk3s6
          18:43:09 Waiting for unmount to complete. 1 Disk unmounted.
          18:43:10 Unmounting - Completed
          18:43:10 Resize IMG - Resizing and Rebuilding IMG file
          18:43:10 RESIZE - Attempting to RESIZE a Linux partition in the IMG file "Raspberry.img"
          18:43:10 RESIZE - Find Ext2/3/4 partition and determine size and location
          18:43:10 RESIZE - ERROR: No Linux partitions found
          18:43:10 Error - No Linux partitions found

          Reply

          Sandra

        • Jun 25, 2019 - 3:55 PM - hans - Author: Comment Link

          You may want to disable the “Expand/Shrink” function before flashing the renamed file. 
          (5th button from the right should be gray)

          Reply

          hans

  • Jun 25, 2019 - 11:04 PM - Sandra Comment Link

    All those Function buttons was missing until in changed Theme. I have seen these buttons earlier.

    I tried flashing when Expand/Shrink was disabled and it worked.

    Reply

    Sandra

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

      Hi Sandra,

      good to hear it finally worked out.
      What version of ApplePi-Baker are you using? I thought I had fixed the “missing buttons” issue in the latest version.

      Reply

      hans

      • Jun 27, 2019 - 12:23 PM - Sandra Comment Link

        I use 2.1.0

        Reply

        Sandra

      • Jun 27, 2019 - 1:59 PM - hans - Author: Comment Link

        OK that explains it … the most recent version (at this moment) is 2.1.3 (see the original article).

        Reply

        hans

        • Jun 27, 2019 - 9:24 PM - Sandra Comment Link

          Both “Download Now” and “The direct download link to the latest version will always be https://www.tweaking4all.com/ApplePi-Baker2.dmggives same old 2.1.0 file.


          Downloaded filename is correct: ApplePi-Baker-v2.1.3.dmg

          Size: 4 048 849 bytes

          Reply

          Sandra

        • Jun 28, 2019 - 9:30 AM - hans - Author: Comment Link

          That is interesting … nice catch!

          Both links give me 2.1.3 (dmg and application).

          I did notice that I may not have updated the version number in the info.plist (an Apple specific info file buried in the app bundle) – so I assume you check the version number through the “Get Info” option in Finder (which indeed shows 2.1.0).
          When you start APB it will show a version number in the titlebar of the APB window (2.1.3).

          Thank you very much for catching that  … I’ll try to update the version info correctly in the next few days.
          And rest assured that the version number in the title bar of the APB window is the only always 100% correct version number (it’s generated by the development environment I’m working with). I’ll write a script to automatically update the Info.plist file as well so that “Get Info” will display the correct info (it’s a pain to have to update the version number in multiple places). 

          Reply

          hans

  • Jul 17, 2019 - 12:40 AM - Sandra Comment Link

    I use ApplePi-Baker 2.1.3 (Build 98) and i tried first time expand/shrink.

    I shrink Raspbian 16GB sd-card and then tried to expand that image to another 16GB sd-card but your app said:

    This selected Disk is too small:
    /dev/disk3 (32 GB Generic- USB3.0 CRW -SD) (179,830,784 bytes short)

    Shrinked image is 4.5 GB and non shrinked data size surely should fit to my new 16GB card.

    I tried it and got error: kernel panic not syncing vfs- unable to mount root fs on unknown-block(179,7)

    Any way around this?

    Reply

    Sandra

    • Jul 17, 2019 - 4:35 AM - hans - Author: Comment Link

      Hi Sandra,

      sorry to hear you’re running into issues.
      If I understand you correctly, this would indeed be weird – would you be able to email me the entire content of the log window (when you’re trying to flash the shrunken image to the 16Gb SD)?
      I assume the “kernel panic” error is when you boot your Raspberry Pi with the SD card?

      Reply

      hans

  • Oct 22, 2019 - 4:56 AM - kenneth himschoot Comment Link

    ApplePiBaker2 is much appreciated. The Shrink and Expand functions are a MASSIVE time gain on OS X. This rocks.

    Reply

    kenneth himschoot

    • Oct 22, 2019 - 9:12 AM - hans - Author: Comment Link

      Thanks Kenneth for taking the time to post a thank-you!
      It’s highly appreciated!  

      Reply

      hans

  • Nov 16, 2019 - 5:31 AM - thomas Comment Link

    Hi, great work !

    do you have a version 2 for old OS 10.9 ?

    Reply

    thomas

    • Nov 16, 2019 - 6:09 AM - hans - Author: Comment Link

      Hi Thomas,

      unfortunately, I do not have 10.9 available for any development or testing 
      I suppose you are not able to update to the latest (or a newer) macOS (thanks Apple!).

      Reply

      hans



Your Comment …

Do 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.