reinstall_OSX - zollak/pentest-notes GitHub Wiki

Mac Boot options

https://support.apple.com/en-us/HT204904

  • Command (⌘)-R - Install the latest macOS that was installed on your Mac, without upgrading to a later version.*

Note: If you're selling or giving away a Mac that is using OS X El Capitan or earlier, use Command-R to make sure that the installation isn't associated with your Apple ID.

  • Option-Command-R - Upgrade to the latest macOS that is compatible with your Mac.

Note: If you haven't already updated to macOS Sierra 10.12.4 or later, Option-Command-R installs the macOS that came with your Mac, or the version closest to it that is still available.

  • Shift-Option-Command-R - Install the macOS that came with your Mac, or the version closest to it that is still available.

How to create a bootable installer for macOS

Official way: https://support.apple.com/en-us/HT201372

  1. Download macOS

Create a bootable macOS Sierra installer drive

  1. Plug in your USB drive and list it:
MacBook-Pro:~ zollak$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         1.0 TB     disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            623.6 GB   disk1s1
   2:                APFS Volume Preboot                 50.5 MB    disk1s2
   3:                APFS Volume Recovery                510.5 MB   disk1s3
   4:                APFS Volume VM                      4.3 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk2
   1:                  Apple_HFS Install macOS Sierra    8.0 GB     disk2s1
  1. Use the Terminal to create a boot disk
MacBook-Pro:~ zollak$ sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Install\ macOS\ Sierra/ --applicationpath /Applications/Install\ macOS\ Sierra.app
Password:
Ready to start.
To continue we need to erase the disk at /Volumes/Install macOS Sierra/.
If you wish to continue type (Y) then press return: Y
Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.
  1. Boot from the installer drive

Troubleshooting

ERROR:

Couldn't mount dmg /Volumes/Install macOS Sierra/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg (error code 110)Mount of outer dmg failed.

Verify Installer:

MacBook-Pro:~ zollak$ hdiutil verify /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg
Checksumming Protective Master Boot Record (MBR : 0)…
Protective Master Boot Record (MBR :: verified   CRC32 $A9C57BFE
Checksumming GPT Header (Primary GPT Header : 1)…
 GPT Header (Primary GPT Header : 1): verified   CRC32 $D77F2898
Checksumming GPT Partition Data (Primary GPT Table : 2)…
GPT Partition Data (Primary GPT Tabl: verified   CRC32 $6D9EBA8C
Checksumming  (Apple_Free : 3)…
                    (Apple_Free : 3): verified   CRC32 $00000000
Checksumming EFI System Partition (C12A7328-F81F-11D2-BA4B-00A0C93EC93B : 4)…
......
EFI System Partition (C12A7328-F81F-: verified   CRC32 $B54B659C
Checksumming disk image (Apple_HFS : 5)…
.....................................................................................................................................................................
          disk image (Apple_HFS : 5): verified   CRC32 $C16DFE8C
Checksumming  (Apple_Free : 6)…
........................................................................................................................................................................
                    (Apple_Free : 6): verified   CRC32 $00000000
Checksumming GPT Partition Data (Backup GPT Table : 7)…
........................................................................................................................................................................
GPT Partition Data (Backup GPT Table: verified   CRC32 $6D9EBA8C
Checksumming GPT Header (Backup GPT Header : 8)…
.........................................................................................................................................................................
  GPT Header (Backup GPT Header : 8): verified   CRC32 $38EE2A7A
.........................................................................................................................................................................
verified   CRC32 $3B94F102
hdiutil: verify: checksum of "/Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg" is VALID
⚠️ **GitHub.com Fallback** ⚠️