Friday, March 16, 2018

Resizing Mac APFS disk to create a case-sensitive HFS (hfsx) for Linux sharing and Android builds

Resizing Mac APFS 500Gb to 350Gb and creating HFSx (case-sensitive) for AOSP building.



$ sudo diskutil apfs resizeContainer disk0s2 250g hfsx REPO 0b

..
Shrinking APFS Physical Store disk0s2 from 499,963,170,816 to 249,999,998,976 bytes
Shrinking APFS data structures

[ \ 0%..10%..20%..30%..40%............................... ] 47% 0:00:02 

..

Initialized /dev/rdisk0s3 as a 233 GB case-sensitive HFS Plus volume
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s3
Finished APFS operation
uki 192.168.1.7 13:16 ~ $ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.0 GB   disk0s2
   3:                  Apple_HFS REPO                    249.8 GB   disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume SYSTEM                  220.6 GB   disk1s1
   2:                APFS Volume Preboot                 22.3 MB    disk1s2
   3:                APFS Volume Recovery                509.8 MB   disk1s3

   4:                APFS Volume VM                      1.1 GB     disk1s4



REFERENCE:

http://www.peachpit.com/articles/article.aspx?p=1403238

https://www.macobserver.com/tips/deep-dive/resize-your-apfs-container/