martijnvanbrummelen / nwipe

nwipe secure disk eraser
GNU General Public License v2.0
688 stars 79 forks source link

HPA_DCO_006 - Add HPA/DCO capability #449

Closed PartialVolume closed 1 year ago

PartialVolume commented 1 year ago
  1. If nwipe enumerates a USB bridge that does not support ATA pass through or you are wiping a USB memory stick, nwipe will show a message in the GUI that says "HPA/DCO hidden area indeterminate". If you get this message you know to either get yourself a better quality USB to SATA adapter or in the case of a USB memory stick, i've never come across one that supports HPA/DCO so either don't worry about it and wipe it as normal or physically destroy it.

  2. We now check for a nonsense "real max sectors" as produced by the bug in hdparm. We use our own low level function to issue a DCO identify command and retrieve the correct value.

  3. Changed the dmidecode info at the start of the log from a 'notice' classification to 'info'.

  4. Made changes to the nwipe_log function so that any messages logged that are classified as 'debug' will not be logged unless the --verbose flag has been set on the command line options. I send the hex data structures and hex sense data to the logs as debug information and as they can take up a lot of space and make the log look untidy they will only appear in --verbose mode.

  5. I also extended the nwipe's log message length from 512 to 1024 as some of the sense data was being truncated in the log.

Here's an example screenshot of the "HPA/DCO hidden area indeterminate" shown against the /dev/sdb device which is a USB Sandisk memory stick. Also shown is the "HPA/DCO hidden area detected" against the /dev/sda device. This was attached via a Unitek USB to SATA adapter that allows ATA pass through so we can detect hidden areas. The third device is NVME and HPA/DCO is not relevant to that device so no HPA/DCO message is displayed.

showing_HPA_indeterminate_status-2023-03-10_00 00 17 mp4