GNU+Linux command memo

Clear storage disk

Effacer les données d’un disque dur.

# dd if=/dev/urandom of=/dev/<sdb> bs=1M status=progress (1) (2) (3)
75623301120 bytes (76 GB, 70 GiB) copied, 678,034 s, 112 MB/s (4)
1 Why urandom :
2 Change <sdb> for the correct storage device
3 bs=1M : the default block-size (512o) spoils perf. with modern hardware. Test results :
4 Dynamic output line tracking operations thanks to status=progress
Modern disk hardware and modern filesystems may save data in places where you cannot delete them, so this process may still leave traces. The only safe ways of wiping data are the ATA Secure Erase command (if implemented correctly), or physical destruction.

To only destroy the MBR (Master Boot Record) :

# dd if=/dev/zero of=/dev/<sdb> bs=446 count=1

To repeat the process several time :

# for N in `seq 7`; do dd if=/dev/urandom of=/dev/<sdb> bs=1M status=progress; done;