How to check the actual/inconsistent disk usage of a File share (SMB) in Storage Account?

Gregorio Montaño 251 Reputation points
2024-07-31T20:07:37.3133333+00:00

Hi,

Good day!

I am checking why there is an inconsistency of "Total data stored" reflecting on "File shares" (SMB) of a Storage account vs what was reflected with "df -h" command. The Dashboard was showing 995GiB but the CLI returns 38G of disk used.

Please assist. Thanks.

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Nehruji R 8,181 Reputation points Microsoft External Staff Moderator
    2024-08-01T12:32:52.4966667+00:00

    Hello Gregorio Montaño,

    Greetings! Welcome to Microsoft Q&A Platform.

    I understand that you are seeing a discrepancy between the “Total data stored” on the File shares (SMB) of your Storage account and the output of the df -h command. It is due to the calculations done by the Azure storage usage and the disk usage.

     

    There are several factors like Azure's dashboard reflects the total data stored in your file shares like data from metadata, deleted files and any snapshots and if soft delete is enabled on that storage is also being reflected until it is deleted permanently.

     

    The operating system Disk usage 'df -h' command shows the disk space usage of the mounted file, the df -h Reflects only the currently accessible files and their sizes, and it does not reflect the space of the metadata, deleted files and snapshots. Only shows the primary data and not reflects the replication of the other stored data.

     

    Here is the doc for your reference: https://learn.microsoft.com/en-us/azure/virtual-machines/disks-shared-enable?tabs=azure-portal

     

    Try setting up monitoring software on the servers that report to a central location, or you can create a PowerShell script that retrieves the data. More information about to create a PowerShell script can be seen in this blog as well, where you can further setup commands to monitor your free space in your network drive:

    https://social.technet.microsoft.com/Forums/ie/en-US/80d42412-e740-4146-9ad3-70ec6755d9c3/script-to-monitor-free-space-in-unc-path-network-drive?forum=winserverpowershell

    In addition, you can map the shared folder as a drive - this will show you how much free space is available on the shared folder. You can follow the steps to achieve this goal:

    1)In windows explorer, browse to the network share, then to the folder that you want to check the disk usage, right client on the folder and select properties.

    2)In the properties window, click on the "OES Info" tab, and check the "Space Available" field.

    Similar thread for reference - https://stackoverflow.com/questions/55580258/how-to-get-the-remaining-amount-of-storage-space-in-a-shared-folder.

    Hope this answer helps! please let us know if you have any further queries. I’m happy to assist you further. 

    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Gregorio Montaño 251 Reputation points
    2024-08-09T02:08:04.0933333+00:00

    Looks like answer related more to a Windows OS. We have a similar setup where SMB file shared across several Linux VMs and disk usage is consistent. Regards,

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.