Reclaim Disk Space from Shadow Copies

 Hi, 

I have found an strange issue that occurs sometimes. Seems that if Backup software fails, or leaves a task incompleted, the shadow copy is not deleted. This causes the disk space to be retained.

Majority of backup solutions today uses VSS in Windows for take some kind of "snapshot" of the disk. That is a good thing, but maybe you will experience this situation.

In my case, sometiemes this happens when using an Hyper-V Cluster and a bacukp job is interrupted.

The first sign is that suddenly you are low in disk space. And seems to be consuming more and more over time...

If you have Cluster Shadow Volumes (CSV) and you count the content, you will find that the amount of disk space does not match. For instance, here I have about 2.8TB of data, and my disk has a total of 3.8. So I should have about 1TB of free space. 


However, I only have 370GB of free space.



This is a sign of something wrong.
In my case, executing this commands should help.

Fist, you should go to the server who is hosting the CSV Volume. It's important to be aware that CSV are shared across multiple servers, so you must find in Failover Cluster who is the current owner of the disk. Depending on your environment, this could be an Hyper-V server, or a SMB File Server.

Execute this commands:

DISKSHADOW

LIST SHADOWS ALL

then you will see the shadows of CSV volumes. You can delete an specific shadow copy using the ID:

DELETE SHADOWS ID {XXX-XXX-XX-XX-XXX}

Example:


So, there I found that my CSV Volume mounted in C:\ClusterStorage\Volume2 has a shadow copy.

In this case, for deleting this, I must execute:

DELETE SHADOWS ID {XXX-XXX-XX-XX-XXX}

Example:

DISKSHADOW> DELETE SHADOWS ID {325ff91c-d6f9-4e70-aec6-30b51ed60797}

Deleting shadow copy {325ff91c-d6f9-4e70-aec6-30b51ed60797}...

1 shadow copy deleted.

DISKSHADOW>


If you do it correctly, you will reclaim the disk space from your drive, and stopping this strange behavior. Now I do have my 1TB of free space again.


Until next time.

Comments

Popular posts from this blog

Update DNS static servers in your local Network

Error 'General access denied error' (0x80070005). Starting SCVMM Resource

Powershell Scritp for Inventory VMS in Hyper-V and VMware