- Plug in your external storage and use the following command to see which /dev/diskN node it's located on:
diskutil list
- Unmount the disk where
N
is the number of the disk
diskutil unmountDisk /dev/diskN
If the above command was successful, you will see:
Unmount of all volumes on diskN was successful
- Secure erase the disk where
N
is the number of the disk
sudo diskutil secureErase <security level> /dev/rdiskN
Security levels:
0 - Single-pass zeros.
1 - Single-pass random numbers.
2 - US DoD 7-pass secure erase.
3 - Gutmann algorithm 35-pass secure erase.
4 - US DoE 3-pass secure erase.
- Eject the disk where
N
is the number of the disk
diskutil eject /dev/diskN