Disk wiping

From Notes to self
Revision as of 14:45, 21 March 2019 by Verbovet (talk | contribs)
Jump to navigation Jump to search
  • To wipe an HDD by writing zeros to it:
# ddrescue --force /dev/zero /dev/sdX
The average speed is above 100 MB/s, so 1 TB takes about 2-3 hours.
  1. Delete all partitions
  2. # isdct delete -intelssd #
The index # can be found by using the command
# isdct show -intelssd
  1. Make sure the drive is not frozen, support "enhanced erase" and hdparm prints "[number]min for SECURITY ERASE UNIT":
    # hdparm -I /dev/sdX
    [...]
    Security:
    Master password revision code = 65534
    supported
    not enabled
    not locked
    not frozen
    not expired: security count
    supported: enhanced erase
    3min for SECURITY ERASE UNIT. 3min for ENHANCED SECURITY ERASE UNIT.
    [...]
  2. Set a user password (this password will be cleared on the next step, so the exact choice does not matter):
    # hdparm --user-master u --security-set-pass foo /dev/sdX
  3. Issue the ATA Secure Erase command:
    # hdparm --user-master u --security-erase foo /dev/sdX
  4. Check that security is disabled:
    # hdparm -I /dev/sdX
    [...]
    Security:
    Master password revision code = 65534
    supported
    not enabled
    not locked
    not frozen
    not expired: security count
    supported: enhanced erase
    3min for SECURITY ERASE UNIT. 3min for ENHANCED SECURITY ERASE UNIT.
    [...]