


If you select the wrong drive you WILL destroy your data. Here I identified the /dev/sdc drive as the drive I want to securely erase. I/O size (minimum/optimal): 512 bytes / 512 bytesĭevice Boot Start End Sectors Size Id Type Sector size (logical/physical): 512 bytes / 512 bytes Here is an example output of the same disk using fdisk -l : ~]$ sudo fdisk -lĭisk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors In this case I am using the latter, but fdisk is more reliable. We can use fdisk or we can list out the /dev/disk/by-label/ directory. Now connect the drive to the computer and identify the device name. Sudo apt-get install -y hdparm Identify the Drive to Be Wiped / Security Erased Or on Ubuntu / Debian: sudo apt-get update -y Install the hdparm Utility On Your System ~]$ sudo dnf install hdparm We will use the hdparm utility to interface with the drive firmware and issue the Secure Erase command. In the case of SSDs this feature will set the cells back to the factory default state, effectively erasing all data from the drive. This Secure Erase feature tells the drive to write zeros to the entire disk. Securely Erasing SATA Drives Using hdparm Utility in Linuxįor the last couple of decades manufacturers have been including a Secure Erase feature in the firmware of SATA/PATA drives including SSDs and traditional spinning disk hard drives. DO NOT copy and paste commands from this article unless you are 100% sure you are using the correct syntax. When possible, we recommend backing up ALL data and disconnecting any drives that you do not intend to erase.

If not used correctly unintended data loss may occur. WARNING: This article provides methods that will destroy ALL data on your hard drive. This method is effective on any SATA / PATA hard drive, including destroying hard drives from a system running Windows or any other operating system. In this article we will discuss how to securely erase a hard drive before disposal.

Since most people do not encrypt their drives someone can very easily pull all the data off of these old discarded hard drives. However, there is a real threat to someone getting there hands on your old hard drive. Most of the time this is for innocent enough reasons. There have been many stories about people discarding old computers only to have someone pick them out of the trash.
