Space used by files in dirscan fetches wrong values
search cancel

Space used by files in dirscan fetches wrong values

book

Article ID: 265619

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

We are using Dirscan and When fetching "space used by files" we noticed a small but significant mismatch between the value we observe on the machine in comparison to the fetched value. 

 

du -shk command shows: 259632 KBs

the probe shows:              258423 KBs

 

 

How can we explain this difference? 

What are the commands used by the probe to fetch the "Space used by files" value? 

Environment

Release : UIM 20.4, dirscan any version

Cause

In Linux, the difference between the value fetched by du -shk [shows kb] or du -shb [show bytes] and the value fetched in the probe GUI used space is given because the probe uses a different command to fetch the the value. 

"du -shk" returns "Size on Disk"

but the probe returns "Size" 

Read more: windows - What is the difference between “Size” and “Size on disk?” - Super User

 

In windows, this is easily viewable in Windows as the value fetched by the probe corresponds to the "Size" in any folder's properties and not the "Size on disk"

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=F9JBM0NKBybgrzBGU0GxFg==

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=E8CJgmW0eU+WazQbs+gKKw==

 

Resolution

When the probe fetches the "space used by files", it fetches the sum of the space used by each individual file in the directory. In any Windows folder properties, there are two sizes, size, and size on disk, the size is the sum of the files in the directory.
The value that the probe shows will be similar to this.

Similarly, on linux, "du -shk" command gives the size on disk not the size. The probe uses "stat" command to fetch the size.

To compare the values you can use the below-mentioned command to know the size (differently from the "size on disk"), this value will be similar to the value probe will fetch.

find /opt/nimsoft -type f -print0 | xargs -0 stat --format="%s" | awk '{s+=$1} END {print s}


please give the path of the directory in the place of /opt/nimsoft to find the size and while in the probe select bytes (to get the exact values).