Reclaiming space from deleted files


  • We currently have Azure Windows 2012 R2 servers with (Fixed provisioned) storage spaces in place. We are finding that when we delete files, the OS is correctly reporting the disk size but Azure is billing us as if the files still exist. I understand that when files are deleted they are removed from the index only. What I am after is the best practice for reclaiming this space so that we are billed more accurately, could anyone please advise?  
    • Changed type Loydon Mendonca Thursday, March 30, 2017 4:23 PM Changing type to question
    • Moved by Loydon Mendonca Thursday, March 30, 2017 4:23 PM Moving to Azure Storage forums
    Thursday, March 30, 2017 8:35 AM

All replies

  • What performance tier have you chosen for your Azure Storage account? Premium or Standard?

    For instance, if you have provisioned an empty 100GB disk which is backed by a Premium Storage Account then you will be charged for a P0 (128GB) disk. If any other type of Storage Account is used then you’ll only be billed for the storage space used to store the data that is written to the disk regardless of the allocated disk size. Refer the Storage pricing page for more information.

    Thursday, March 30, 2017 8:38 PM
  • Assuming that you are using Standard storage with non-managed disks, then you should enable TRIM - more at


    Thursday, March 30, 2017 10:27 PM
  • Thank you for your help so far.

    My storage account is standard with non-managed disks.

    I was aware of trim but double checked and the three servers that I have in this storage account have trim enabled.

    I logged on to each server and added up the disk space used on the OS and Data disks and it adds up to 1.2TB. When I go to the Azure portal the storage capacity for this storage account is 2.2TB.

    Any thing else I can try?

    Friday, March 31, 2017 10:42 AM
  • Could you check the contents of your storage account using the Azure Storage Explorer and see what else is occupying the account. Although that's a huge difference of about 1 TB you've mentioned there might be logs occupying that space in your storage account.
    Saturday, April 1, 2017 3:58 PM
  • When using Azure Storage Explorer to access the storage account, I get the following:

    I have deleted all logs from these tables and will monitor any change in storage capacity. However, I am not optimistic that this will account for the 1TB difference. I will confirm once the Azure portal has updated. Thank you for your help so far.

    Monday, April 3, 2017 11:43 AM
  • This morning I checked my storage account and it has jumped back up to 2.2TB.

    The OS and Data disks add up to 1.2TB. I have removed all logs from the Storage account using Azure Storage Explorer and the Portal does not show anything using space.

    Is there anything else I can try?

    Tuesday, April 4, 2017 8:00 AM
  • Could you also check under each section in the explorer tool for 'Blob Containers' (and then under vhds), 'File Shares' and 'Queues' that might be contributing to the data usage.

    • Proposed as answer by Md Shihab Wednesday, April 5, 2017 12:01 PM
    Tuesday, April 4, 2017 2:30 PM
  • Yesterday I deleted 300GB of files and ran optimize on the servers in the storage account. I have done this many times before. However, this time it took slightly longer than normal. This morning I have found that my storage account has shrunk by 1TB and it is showing what I am expecting.

    Thank you all for your help with this, it is really appreciated.

    Wednesday, April 5, 2017 7:56 AM