The VMware Carbon Black Tech Zone is live! Checkout this great resource: Mastering Carbon Black Audit & Remediation.

Disk utilization on Windows

This query converts the size and free space to GB, then calculate the percent full for the disk.

+-----------+------------------+-------------+-----------------+-----------+--------+

| device_id | description      | file_system | free_space (GB) | size (GB) | %_free |

+-----------+------------------+-------------+-----------------+-----------+--------+
| C:        | Local Fixed Disk | NTFS        | 0.94            | 7.43      | 12.65  |

+-----------+------------------+-------------+-----------------+-----------+--------+

 

select device_id,description,file_system,

  printf("%.2f", free_space/8589934592.0) as 'free_space (GB)',
  printf("%.2f", size/8589934592.0) as 'size (GB)',
  printf("%.2f", (printf("%.2f", free_space/8589934592.0)/printf("%.2f", size/8589934592.0))*100) as '%_free'
from logical_drives
where size != '-1';

 

 

 

Tags (2)
3 Comments
jnelson
Carbon Black Employee
Status changed to: Approved
 
rnadeau
Carbon Black Employee

@jnelson I believe this needs to be "%_free"

jnelson
Carbon Black Employee

@rnadeau math is hard. Thanks!