How To - Zero Out (Wipe) a Disk

In this tutorial, I will show you how to write all zeros or ones to a disk, completing wiping the data off of the drive. This is a recommended step to secure your data when you are disposing, selling, donating, or recycling a computer.

Caution

When wiping data from disks, it's important to pay atention to avoid making accidents and causing serious headaches. Take a moment to verify commands before pressing enter and use good judgement when running these commands.

Notes

  • Writing all zeros to a disk is slow. Please consider that the operation may take several hours to complete.

Operating System Instructions

Windows

  1. Open an elevated command prompt.
  2. run diskpart
  3. Find your disk with list disk
  4. Select the disk with select disk x where x is the number of the drive you wish to wipe.
  5. run clean all
  6. Wait patently as Windows does not provide a status indicator.

diskpart

MacOS

  1. Open terminal
  2. run diskutil list and make note of the /dev/diskX number you wish to wipe
  3. run diskutil zerodisk /dev/diskX where X is the number gathered from the previous step

Screen-Shot-2022-09-17-at-11.22.15-AM

Linux

  1. Open terminal
  2. run lsblk to list disks
  3. run pv < /dev/zero > /dev/<diskID> where diskID is the disk from the previous command.

Screenshot-from-2022-09-17-11.44.53@2x