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
- Open an elevated command prompt.
- run
diskpart
- Find your disk with
list disk
- Select the disk with
select disk x
where x is the number of the drive you wish to wipe. - run
clean all
- Wait patently as Windows does not provide a status indicator.
MacOS
- Open
terminal
- run
diskutil list
and make note of the /dev/diskX number you wish to wipe - run
diskutil zerodisk /dev/diskX
where X is the number gathered from the previous step
Linux
- Open
terminal
- run
lsblk
to list disks - run
pv < /dev/zero > /dev/<diskID>
where diskID is the disk from the previous command.