- Plug in your SD card, HDD, or other block device and then 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 taken from the above command:
diskutil unmountDisk /dev/diskNIf the above command was successful, you will see:
Unmount of all volumes on diskN was successful
- Execute
ddcommand as super user on disk where "N" is the number of the disk from step 1.
sudo dd if=/dev/urandom of=/dev/diskN bs=1000000This will overwrite all partitions, master boot records, and data. Please note that this may take a while depending on the size of your disk and there is no progress indicator. However; If you want to check whether or not dd is working you can always use pv (Available on Homebrew) which will dump out the raw data being written to the disk.
sudo pv /dev/disk1