martijnvanbrummelen / nwipe

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

HPA_DCO_005 - Add HPA/DCO capability #448

Closed PartialVolume closed 1 year ago

PartialVolume commented 1 year ago
  1. Created the function nwipe_read_dco_real_max_sectors() which directly accesses the disk drive sending a 0xB1 device configuration overlay identify command to the drive. We read the returned data structure extracting the real max sectors value. We do this if hdparm returns nonsense for the real max sector (as it does in hdparm v9.60) for some larger drives. This value is automatically sent to the nwipe log FYI.

  2. Added a stdout & stderr pipe to the hdparm commands as verbose data appears to be sent to stderr, as we are interested in that data this pipe captures stderr as well as stdout.

  3. Added headers "scsi/sg.h" and "scsi/scsi_ioctl.h" as we are now sending low level commands to the drives.