hdparm vs /dev/zero in hdd erase

Solution 1:

They use different methods, and the effectiveness may depend on the drive. The former uses the 'newer' ATA secure erase command and the latter just overwrites it with zeros.

For really old drives that don't have ata secure erase supported, the latter is the only way to do it - it just overwrites the drive with zeros and in many cases thats enough (though using something like the shred command is better - since its designed specifically to wipe out data, unlike DD). Most drive wouldn't be accessible after a wipe.

However, with SSDs, data is intentionally internally scrambled and stored for wear levelling purposes. overwriting it with zeros should work, but it isn't certain - in which case doing a sata secure erase is a better solution. It may also provide a short term performance boost on a drive that is suffering from write amplification. Sata secure erase will trigger the internal erasure method, and is the best way to be assured of a wipe.

In most modern drives the hdparm method should be sufficient and reliable enough to use. If you need to zero out a drive for whatever reason, use the dd method.