1 2 Previous Next 19 Replies Latest reply on Dec 16, 2019 11:00 AM by wigson Go to original post
      • 15. Re: Shrinking APFS?
        persfu Lurker

        It seems don't work for VMware (15.5) and macOS10.15.1 on Windows:

         

        (1) The first command seems ok:
        dd if=/dev/zero of=/Users/<account name>/zero.bin bs=1m

         

        (2) The second command works:

        rm /Users/<account name>/zero.bin

         

        (3) The third command on Windows doesn't work:

        "C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe" -k <VMDK_DISK>

         

        Here is the popup message:

        "This app can't run on your PC. To find a version for your PC, check with the software publisher."

         

        Tried VM -> Settings -> Hard Disk -> click "Defragment", then "Compact", the vmdk file keeps the same size(it should be shrunk).

        • 16. Re: Shrinking APFS?
          persfu Lurker

          Here is what I did to shrink VMware 15.5.1 macOS Catalina 10.15.1 vmdk file using Carbon Copy Cloner (CCC) :

           

          Step01: Create three virtual machines VM1, VM2, VM3 using VMware15.5.1.

           

          Step02: On VM1: Install MacOS10.15.1 and CCC, then shutdown.

           

          Step03: On VM1: Add VM2 and VM3's hard disk (HD) (empty, unformated) to VM1.

           

          Step04: On VM1: Power on and format VM2 and VM3's HD in APFS format using Disk Utility, then shutdown.

           

          Step05: On VM1: Remove VM2 and VM3's HD from VM1 and backup these two HDs (empty, APFS) for the future use (IMPORTANT!).

           

          Step06: On VM2: Install MacOS10.15.1 and apps (if needed), then shutdown.

           

          Step07: On VM1: Add VM2's HD (installed) and VM3's HD (empty, APFS) to VM1.

           

          Step08: On VM1: Power on and clone VM2's HD (installed) to VM3's HD (empty, APFS) using CCC, then Shutdown.

           

          Step09: On VM1: Keep VM3's HD (cloned) on VM1, remove VM2's HD (installed) from VM1 and add VM2's HD (empty, APFS) to VM1.

           

          Step10: On VM1: Power on and clone VM3's HD (cloned in Step08) to VM2's HD (empty, APFS) using CCC, then Shutdown.

           

          Now the VM2's HD is shrunk from 23.1GiB to 14.4GiB if VM2 is clean installed.

           

          Note1: The VM2's HD already shrunk to VM3's HD in step08, but it will show two duplicated HDs in VM3's Finder.

           

          Note2: Must add the original VM2's HD (empty, APFS) in step09 to avoid showing two duplicated HDs in VM2's Finder.

           

          Note3: It's not allowed to add two unique HDs to VM1 and clone from one HD to another using CCC.

           

          Note4: In Step07-08, the cloned VM3 wouldn't power on if add VM2's HD (installed), VM2's HD (empty, APFS), VM3's HD (empty, APFS) and clone from VM2's HD (installed) to VM3's HD (empty, APFS) using CCC.

           

          Note5: Only Step07 to Step10 are required for the future use to shrink vmdk files.

           

          Note6: There is no need to create VM1 if install CCC to VM2 in step06, but this will lead using VM2 instead of VM1 in Step07-08 and using VM3 instead of VM1 in Step09-10, and will lead installing multiple copy of CCC.

          • 17. Re: Shrinking APFS?
            dlhotka Virtuoso

            This triggered a thought about another option:

             

            1) Create a new OSX virtual machine

            2) Before powering on, add the previous VM's virtual disk

            3) Power on VM, when prompted, choose 'migrate from another mac'

            4) Let migration wizard run

            5) shut down the VM and remove the previous virtual disk


            That should (assuming the installer/migration process doesn't blow out temp disk space) also reduce the virtual disk usage.

             

            Note to the Fusion team - shrinking OSX guests would be a nice feature at some point :-)

            • 18. Re: Shrinking APFS?
              persfu Lurker

              Here is what I did to shrink VMware 15.5.1 macOS Catalina 10.15.1 vmdk file using "Disk Utility":

               

              Step01: Create three virtual machines VM1, VM2, VM3 using VMware15.5.1.

               

              Step02: On VM1: Install MacOS10.15.1, then shutdown.

               

              Step03: On VM1: Add VM2 and VM3's hard disk (HD) (empty, unformated vmdk file) to VM1.

               

              Step04: On VM1: Power on and format VM2 and VM3's HD in APFS format using "Disk Utility", then shutdown.

               

              Step05: On VM1: Remove VM2 and VM3's HD from VM1 and backup these two HDs (empty, APFS format) for the future use (IMPORTANT!).

               

              Step06: On VM2: Install MacOS10.15.1 and apps (if needed), then shutdown.

               

              Step07: On VM1: Add VM2's HD (installed) and VM3's HD (empty, APFS format) to VM1.

               

              Step08: On VM1: Power on and save image of VM2's HD (installed) to VM3's HD (empty, APFS format) using "Disk Utility"(*), then Shutdown.

               

              * Here is how:

               

              (1) Start "Disk Utility"

               

              (2) View -> Show All Devices

               

              (3) Choose VM2's all volumes (example: "macOS", "macOS - Data") and Unmount them (File -> Unmount) (IMPORTANT!).

               

              (4) Choose VM2's "Container disk{n}", then save image to VM3's HD (File -> New Image -> image from "Container disk{n}"). Choose Format as: compressed; image name: "macOS_v1.dmg"(example). Here n=1,2,3, etc.

               

              (5) Images -> "Scan Image For Restore" (IMPORTANT!) -> choose the image and scan.

               

              Step09: On VM1: Keep VM3's HD (with saved image "macOS_v1.dmg" of VM2's HD) on VM1, remove VM2's HD (installed) from VM1 and add VM2's HD (empty, APFS format) to VM1.

               

              Step10: On VM1: Power on and Restore image "macOS_v1.dmg" from VM3's HD (saved in Step08) to VM2's HD (empty, APFS format) using "Disk Utility"(**) , then Shutdown.

               

              ** Here is how:

               

              (1) Start "Disk Utility"

               

              (2) View -> Show All Devices

               

              (3) Choose VM2's "Container disk{n}". Here n=1,2,3, etc.

               

              (4) Edit -> Restore -> choose the image "macOS_v1.dmg"(example).

               

              (5) There is a popup message says: "The disk image 'macOS_v1.dmg' contains more than one APFS volume. Choose which volume to restore."

               

              Choose what ever "macOS" or "macOS - Data", then click "Restore", after finishing restore, wait for a while and then Shutdown (doesn't matter which volume to choose, it will restore both volumes).

               

              Now the VM2's HD is shrunk from 23.1GiB to 14.3GiB if VM2 is clean installed.

               

               

              Note1: Add the original VM2's HD (empty, APFS format) in step09 is not required, you can add a new HD (created by MacOS10.15).

               

              Note2: It's not allowed to add two unique HDs to VM1.

               

              Note3: Only Step07 to Step10 are required for the future use to shrink vmdk files.

               

              Note5: There is no need to create VM1 if boot from macOS10.15.1's bootable ISO file in step07-10.

              • 19. Re: Shrinking APFS?
                wigson Lurker

                It seems don't work for VMware (15.5) and macOS10.15.1 on Windows:

                Not confirmed - it is fine worked!

                1 2 Previous Next