storaged-project / udisks

The UDisks project provides a daemon, tools and libraries to access and manipulate disks, storage devices and technologies.
https://storaged.org/doc/udisks2-api/latest/
Other
347 stars 142 forks source link

Add secure erase options for mechanical drives #971

Open hadess opened 2 years ago

hadess commented 2 years ago

There are separate issues files about making it possible to use the SATA Secure Erase command, and its NVME equivalent. This bug is about having an API for secure erasing mechanical drives.

Ideally, the API would make it easy to implement a UI like macOS' Disk Utility one.

erase-options-1 erase-options-2 erase-options-3 erase-options-4

tbzatek commented 2 years ago

ATA Secure Erase has been available for some time: http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Drive.Ata.html#gdbus-method-org-freedesktop-UDisks2-Drive-Ata.SecurityEraseUnit, is that what you're looking for?

There's also an option to erase 'drive' as part of the block Format() method: http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format In this case please be wary of this potential dangerous issue: #977

And for NVMe I'm working on controller-level sanitize operation right now, this one will be later available on namespace level as well. Also the namespace format operation has an option for secure erase (that's technically different from sanitize) - all on the short-term TODO list.

hadess commented 2 years ago

There's also an option to erase 'drive' as part of the block Format() method: http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format In this case please be wary of this potential dangerous issue: #977

It's about how the drive is erased so I would guess that adding erase=... options for the 2-pass erase (random data + zeroes), the DOE 3-pass erase, and the 7-pass erase would fit this particular RFE.