= Erasing Drives = There are a variety of methods for erasing the contents of a disk or solid state drive. <<TableOfContents>> ---- == Hdparm == '''`hdparm(8)`''' is a specialized utility for managing ATA hard disk drives. Its erasure functionality will only be available to devices that offer secure erase. To inspect a drive's features, try: {{{ hdparm -I /dev/X }}} The erasure command is: {{{ hdparm --user-master u --security-erase Eins /dev/X }}} For more details on the use of `hrparm(8)` to erase drives, see [[https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase|here]]. ---- == Dd == The classic UNIX method for erasing a drive is to use `dd(1)` with a meaningless input; this would often be `/dev/urandom` or `/dev/zero`. {{{ dd if=/dev/urandom of=/dev/X }}} The disadvantage of `dd(1)` is that it relies on the device's firmware to honestly report the size and location of storage. For a non-malicious example: failed sectors can be remapped and become effectively invisible to userland utilities. ---- CategoryRicottone