Skip to content

Instantly share code, notes, and snippets.

@lucascantor
Last active February 10, 2018 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucascantor/5316443b3e791c8301196a11b85adf66 to your computer and use it in GitHub Desktop.
Save lucascantor/5316443b3e791c8301196a11b85adf66 to your computer and use it in GitHub Desktop.
Overwrite the macOS disk partition table and re-partition over encrypted data without causing excessive wear by explicitly erasing the full SSD
# Replace N in diskN with the disk number of your choice
# Use "diskutil list" to confirm, and ALWAYS back up your data
dd if=/dev/zero of=/dev/diskN bs=512 count=1
diskutil partitionDisk /dev/diskN 1 GPT APFS "Macintosh HD" 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment