Hacker News new | ask | show | jobs
by jabberwcky 1953 days ago
This option is horrendously inefficient on most modern drives. For many SSDs, issuing a secure erase request is an almost instantaneous process as it only requires the drive to generate a replacement encryption key, and need not even entail bulk writing or erasing physical flash pages
1 comments

Writing 1 GB of zeros is also almost instantaneous. Even though it's overkill, writing 1 GB is hardly worth worrying about. Though I'd recommend also wiping the backup GPT at the end of the drive.
It is still bad advice, zero filling an SSD is not nearly the same as erasing it due to the presence of large (up to 10% or more of the drive) overprovisioning areas present in all devices, ignoring the permanent wear zero-filling the drive also causes, and the fact the controller believes real data remains stored, placing restrictions on its ability to perform internal maintenance
It's fine advice. The wear of writing 1GB of zeros can and should be ignored. It's insignificant. And the drive's spare area is only relevant if you're trying to thoroughly wipe sensitive information from a device before disposing of it. But right now we're just trying to make a device appear functionally empty so that we can re-install an OS without remnants of any previous installation getting in the way. This does not require the (sometimes dubious) security assurances of a secure erase command.
> But right now we're just trying to make a device appear functionally empty so that we can re-install an OS without remnants of any previous installation getting in the way

The only portable, reliable, robust way to accomplish this is wiping the drive. If the original author had issued a secure erase, they would not have encountered any subsequent difficulties, all of which were due to partially erasing the device.

> The only portable, reliable, robust way to accomplish this

That's setting the bar too high. If we're comfortable with solutions that will work on all mainstream PC platforms including Macs, then it is sufficient to overwrite partition tables with zeros. I have never heard of an OS installer that scans for deleted partitions, and worrying about the possibility of such a thing causing problems is unreasonable.

GPT along with most filesystems store a bunch of stuff at random places around the disk, for many filesystems it's even configurable.

The most usual problem with your approach is recreating a set of partition tables exactly matching the old tables, while failing to wipe out a filesystem signature buried halfway into the disk. One reboot later, and magic header bytes start to be recognized as valid filesystems by whatever OS installer or BIOS utility you happen to be using. Even worse if you're been taking some hacky shotgun approach to blowing holes in the drive by zeroing out random sectors that belong to one of those recognized filesystems.

So once again,

> The only portable, reliable, robust way to accomplish this is wiping the drive