Follow these steps to securely erase your Mac SSD.
This procedure serves as a calming measure 💊 if you find it odd that your SSD can be securely erased in just seconds 😉
- Encrypt and Erase: Use Disk Utility to erase the SSD with APFS (Encrypted) format.
- Overwrite with Random Data: Run a script in Terminal to fill the SSD with random data until full.
- Erase Again: Use Disk Utility to erase the SSD again, 🚮 discarding the encryption key ✅ .
- Restart your Mac and hold down Command (⌘) + R until you see the Apple logo or spinning globe.
- Select Disk Utility from the macOS Utilities window.
- Choose Macintosh HD → Erase.
- Select APFS (Encrypted), set a secure password, and confirm the erasure.
-
Close Disk Utility.
-
Open Safari from the macOS Utilities window.
-
Navigate to the URL: https://github.com/tbsbdr/Secure-erase-Mac-SSD/.
-
Copy the following script:
#!/bin/bash # Define the mount point for the target disk MOUNT_POINT="/Volumes/Macintosh HD" # Check if the mount point exists if [ ! -d "$MOUNT_POINT" ]; then echo "Error: Mount point $MOUNT_POINT does not exist. Ensure /dev/disk3s1 is mounted." exit 1 fi # Change directory to the mount point cd "$MOUNT_POINT" || exit # Set file index for naming file_index=1 # Loop to write 1GB files until the storage is full while :; do file_name="random_data_$file_index.bin" # Use 'dd' to generate random data and write it to a file echo "Creating $file_name..." dd if=/dev/urandom of="$file_name" bs=1M count=1024 status=progress # Check if the write was successful if [ $? -ne 0 ]; then echo "Error writing file. Likely the storage is full." break fi ((file_index++)) done echo "Storage is full or an error occurred. Written $((file_index-1)) files." exit 0
-
Close Safari.
- Open Utilities → Terminal.
- Create the script file using
vi
:vi erase.sh
- Enter the script into vi:
- Press
i
to enter Insert Mode. - Paste the copied script (
Command + V
). - Save the file:
- Press
ESC
. - Type
:wq
, then press Enter.
- Press
-
Make the script executable:
chmod +x erase.sh
-
Run the script:
./erase.sh
-
Wait for approximately 5 minutes (or longer, depending on SSD size) for the script to complete.
- Open Disk Utility again.
- Select Macintosh HD → Erase.
- Choose APFS (Encrypted) or any format of your choice.
- This step discards the encryption key set earlier, effectively scrambling the SSD data.
Your SSD is securely erased, and all data traces have been removed.