Reclaiming missing NTFS disk space from VSS

Issue

I recently faced an issue where Windows Server 2012 R2 reported the remaining 22% of free disk space of one of the Exchange Server data volumes. The Exchange Server data volumes are connected using mount points. 

Before trying to identify any issues regarding hidden system files or streams, I checked the volume shadow copy configuration using the Disk Management MMC.

Windows Disk Management showed that volume C used a mounted volume as a shadow copy target.

Disk Manager Overview and Shadow Copy Details

Examining the available disk space using the Get-Diskspace.ps1 PowerShell script. It showed that WMI was reporting the FreeSpace the same way as the Disk Management.

[PS] D:\SCRIPTS\Get-Diskspace>.\Get-Diskspace.ps1 -ComputerName EX01

Fetching Volume Data from EX01Name                                              Capacity (GB) FreeSpace (GB) BootVolume SystemVolume FileSystem
----  ------------- -------------- ---------- ------------ ----------E:\ExchangeDatabases\DatabaseSet1\                         2048           1083      False        False NTFSE:\ExchangeDatabases\DatabaseSet2\                         2048            445      False        False NTFSE:\ExchangeDatabases\DatabaseSet3\                         2048           1219      False        False NTFSE:\ExchangeDatabases\DatabaseSet4\                         2048           1091      False        False NTFS

Removing the shadow copy of volume C was the only viable solution to reclaim the wasted disk space.

Solution

First, I checked the list of shadow copies using the vssadmin command line tool.

D:\>vssadmin list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool(C) Copyright 2001-2013 Microsoft Corp.
Contents of shadow copy set ID: {eb09ce08-f8a6-47ea-b48d-2d6da7591d4e}   
Contained 1 shadow copies at creation time: 23.06.2017 16:05:56      
Shadow Copy ID: {3684b224-bca2-42c4-a0b3-43b7d0db2d96}         
Original Volume: (C:)\\?\Volume{df40ac48-f610-11e3-80ce-806e6f6e6963}\         
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1         Originating Machine: ex01.granikossolutions.eu         
Service Machine: ex01.granikossolutions.eu         
Provider: 'Microsoft Software Shadow Copy provider 1.0'         
Type: ApplicationRollback         
Attributes: Persistent, No auto release, Differential

The vssadmin tool does not clearly state the path to the shadow copy volume. Therefore, it is much more convenient to identify the shadow copy target using Disk Management. But the output shows that the shadow copy is nearly six months old. So it’s safe to delete this orphaned shadow copy.

You can quickly delete all shadow copies of a selected volume using the following command.

vssadmin delete shadows /for=c: /all

But it turned out that the shadow copy could not be deleted, even with administrative credentials in use.

D:\>vssadmin delete shadows /for=c: /all
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool(C) Copyright 2001-2013 Microsoft Corp.
Error: Snapshots were found, but they were outside of your allowed context.  Try removing them with thebackup application which created them.

A well-known third-party solution is in use to back up the servers. The shadow copy remainders are copies created by the backup solution and were not correctly removed after backup due to a system failure during backup.

But how can you remove the current shadow copy without tempering the existing permissions for your account?

Use the Disk Management MMC to modify the current shadow copy configuration and remove the shadow copy.

  • Open Disk Management MMC
  • Open Properties windows of an existing volume
  • Select the Shadow Copies tab
  • Select the source volume having the shadow copy configured (see screenshot above)
  • Click the Settings button
    • Leave the Located on this volume setting unchanged
    • Change the Maximum size setting to Use limit 320 MB
    • Click OK
Change Shadow Copy Settings to Remove Orphaned Copy

Switch to the command line and check for existing shadow copies.

D:\>vssadmin list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool(C) Copyright 2001-2013 Microsoft Corp.
No items found that satisfy the query.

The orphaned shadow copy is gone.

Now open the Settings windows for the source volume again and change the Located on this volume to be the same as the source volume and change the Use Limit to the same value for the volume configured on other servers.

Volume Shadow Copy Settings

Enjoy Volume Shadow Copies

Links

%d Bloggern gefällt das: