Code Change Request

# 14557

Back to Code Changes

Christopher
Technical Support
StableBit Scanner
2.5.2.3094
Windows Server 2008 R2
Public
Alex

* [Issue #14557] Added DirectIO_DoNotCorrectSize advanced setting. When set to True, we won't correct the drive size 
                 based on the data that we get back from the disk directly.
Public
Alex

Ok, this is not simple. I'm going to post my analysis here because it's a lot of work and I want a record of it, just in case it comes up again.


DISK_GEOMETRY_EX

typedef struct _DISK_GEOMETRY {
  LARGE_INTEGER Cylinders;
  MEDIA_TYPE    MediaType;
  DWORD         TracksPerCylinder;
  DWORD         SectorsPerTrack;
  DWORD         BytesPerSector;
} DISK_GEOMETRY;

typedef struct _DISK_GEOMETRY_EX {
  DISK_GEOMETRY Geometry;
  LARGE_INTEGER DiskSize;
  BYTE          Data[1];
} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;

E7 DA 01 00 00 00 00 00 0C 00 00 00 FF 00 00 00 3F 00 00 00 00 02 00 00 00 00 00 D4 E8 00 00 00 18 00 00 00 01 00 00 00 40 22 0E 53 6E 33 D6 45 AA 05 5C 69 83 BA 19 61 38 00 00 00 00 00 00 00 18 00 18 00 00 00 00 00 EA AC 85 DF 01 E0 FF FF 00 00 00 00 00 00 00 00 00 FC 92 DC 01 E0 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

This decodes to:

0xe8d4000000 / (1024*1024*1024) = 931.3125

So that's a drive size of 931.31 GB.


IDENTIFY

5A 04 FF 3F 37 C8 10 00 00 00 00 00 3F 00 00 00 00 00 00 00 20 20 20 20 20 20 38 4A 30 39 31 30 56 31 37 48 57 54 44 34 03 00 00 00 04 00 41 4A 41 30 35 42 30 36 50 41 4C 50 20 45 44 48 20 44 54 48 35 53 31 34 31 30 41 30 45 39 36 36 20 32 20 20 20 20 20 20 20 20 20 20 20 20 20 20 10 80 00 40 00 2F 00 40 00 02 00 02 07 00 FF 3F 10 00 3F 00 10 FC FB 00 10 01 FF FF FF 0F 00 00 07 00 03 00 78 00 78 00 78 00 78 00 00 00 00 00 00 00 00 00 00 00 00 00 1F 00 06 1F 04 00 5E 00 44 00 FC 01 28 00 6B 74 69 7D 23 61 69 74 49 BC 23 61 7F 40 6F 00 70 00 80 40 FE FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B0 6D 70 74 00 00 00 00 00 00 00 00 03 60 6C 82 00 50 A6 CC D1 C6 7B A3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 40 3C 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 00 0B 00 00 00 00 00 82 21 F1 1C 00 FA 00 00 00 40 00 04 09 00 00 00 47 40 04 05 03 08 03 06 03 07 00 00 00 00 00 00 00 00 00 00 00 00 04 00 41 30 35 42 00 00 04 48 00 00 BD 5D 08 44 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 15 00 00 DB 8D 00 00 00 00 1F 10 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 E0 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A5 8C

This was a tough one and involved consulting the latest ACS spec.

Size of drive is:
512 * 1953525168 = 1000204886016

1000204886016 / (1024 *1024*1024)
= 931.51338958740234375

And that comes to 931.51 GB, which is slightly larger.


I'm guessing that because the Scanner starts to scan at the end of the drive, then those very last sectors can't be read (since they don't actually exist), and that's why you're seeing read errors.

I'm not sure how we can fix this, since the drive is telling us that it knows its size, and it's giving us that size.