- 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/diskN
If the above command was successful, you will see:
Unmount of all volumes on diskN was successful
- Execute
dd
command 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=1000000
This 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
Note that on OS X you can also hit Ctrl+T to show the current process of
dd