We discovered a Win2008R2 server that is reporting a 5% discrepancy in size values for one of its drives, depending on the detection used.
The first property below (Raw Size of Disks) is reporting the same values as seen from the operating system. The second property below (Spaces of Drives) is reporting a total space value for one of the drives (Drive V, NTFS, Healthy (Primary Partition)) to be 5% less of what the operating system sees. The OS sees drive V’s total space to be 3329.87 GB. The native relevance, second property below (Spaces of Drives), sees the V drive’s total space to be 3190 GB. What gives?
Raw Size of Disks: ((it as integer) of string values of selects "Size from Win32_DiskDrive WHERE size!='' " of wmi)
Spaces of Drives: (name of it & " - Size: " & ((total space of it /(1024*1024*1024)) as string & " GB") & ", Used:(" & (((total space of it - free space of it)*100/(total space of it)) as string) & "%25) " & (((total space of it - free space of it) /(1024*1024*1024)) as string & " GB") & ", Free:(" & (((free space of it)*100/(total space of it)) as string) & "%25) "& ((free space of it /(1024*1024*1024)) as string & " GB")) of drives whose(exists name of it AND exists free space of it AND exists type of it AND exists total space of it AND type of it = "DRIVE_FIXED" AND total space of it != 0 AND total space of it > 1024*1024*1024)
I believe that the first WMI query is looking at Physical Disks, while the ‘drives’ inspector is looking at Logical Partitions. See whether these line up as you expect on your system.
For examples, I can see in DiskPart that I have two physical drives and the first of those drives has four logical partitions:
C:> diskpart.exe
Microsoft DiskPart version 10.0.18362.1
Copyright (C) Microsoft Corporation.
On computer: LP1-US-51779528
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 476 GB 1024 KB *
Disk 1 Online 931 GB 0 B
DISKPART> sel disk 0
Disk 0 is now the selected disk.
DISKPART> list par
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 500 MB 1024 KB
Partition 2 Reserved 128 MB 501 MB
Partition 3 Primary 473 GB 629 MB
Partition 4 Recovery 2833 MB 474 GB
The WMI query retrieves info for two Physical Drives:
q: selects "size, DeviceID from Win32_DiskDrive" of wmi
A: DeviceID=\\.\PHYSICALDRIVE0
A: Size=512105932800
A: DeviceID=\\.\PHYSICALDRIVE1
A: Size=1000202273280
T: 12.495 ms
I: plural wmi select
While the native ‘drives’ inspector returns data for logical partitions -
q: (name of it, total space of it) of drives
A: C:, 508478615552
A: D:, 1000197849088
T: 0.189 ms
I: plural ( string, integer )
On my machine, the “C:” partition is on PhysicalDrive0, while “D:” is on PhysicalDrive1. The ‘drives’ inspector returns only the information for the logical partitions that are mounted in Windows - and does not include the “System”, “Reserved”, or “Recovery” partitions that are actually on the disk.
In linux it has 5% discrepancy between what df and bigfix reports. It depends how the df and bigfix calculate the disk allocation. I think df uses the block size of 1k or less or more. The bigfix uses the diff block size while calculating the disk utilization.