Skip to content

some diskutil scripts for mass formatting disks and dumping S.M.A.R.T values

Notifications You must be signed in to change notification settings

dennzo/sh-diskutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

sh-diskutil

ONLY FOR MAC OSX!

Use with caution, as it wipes your disk entirely. :)
I cannot be held responsible for any data loss or damage that might occur.

Requirements

  • smartmontools (installable with homebrew - only needed for erase-disk.sh)

erase-disk.sh - Erasing and resetting a disk

A simple script to quickly wipe all data and create a simple exFAT partition.

Mostly I used this to quickly wipe multiple disks in bulk for example if I want to resell them.

You can connect multiple disks e.g. via USB to SATA/M.2/IDE Adapters.

The script also dumps technical information and S.M.A.R.T values to a textfile which naming is based on the serial number of the drive (since it is unique).

overwrite-disk.sh - Wiping Algorithm Script

This takes a long time, so make sure you take this into account!

Command Algorithm
0 Single-pass zero-fill erase.
1 Single-pass random-fill erase.
2 US DoD 7-pass secure erase.
3 Gutmann algorithm 35-pass secure erase.
4 US DoE algorithm 3-pass secure erase.

This should only be used for HDDs, not SSD.
You can read more on why here.

If you want some in-depth-details about different wiping algorithms you can check out this paper by Michael Wei.