Archive for September 14th, 2014

Tip: Free space after a lot data has been deleted/moved from a Windows Server 2012 (R2) volume with enabled deduplication

Sunday, September 14th, 2014

Hello Folks,

the last day’s i setup a new design for a storage infrastructure, in this infrastructure i’ve moved/deleted round about 6TB of data.

On some volumes was/is deduplication enabled and after i’ve moved a bunch of data away from these volumes to free diskspace the Windows Explorer still shows no “new” free space available. By default Server 2012 and R2 will free diskspace one time per week or with other words you will not get free diskspace by only deleting a file; quite simple.

So how can you force Windows Server 2012R2 to free the diskspace asap? Quite simple, start the PowerShell as Administrator and run the following command:

Start-DedupJob -Type GarbageCollection -Priority High -Volume *yourvolumehere*

After you start the job you can check the status with Get-DedupJob

Wait until the job is finished and check the free space again, it should be available now. I will not explain why deduplication is working in this way here but I did note sometimes Administrators are not aware about the way how it works and that’s the reason why i mention it here.

This is also important if using data deduplication for portable harddisks (not recommended to do so), i’ve seen this already a few times and in this case you are required to run this job manual (mostly).

Have Fun

Michael

P.S.: If you run full backup jobs on a volume like this Microsoft recommends to create a new full backup after the “GarbageCollection” Job is finished, a lot of data can be changed during this job.

P.S.2: For infrastructure’s with a high rate of moving/deleting data on volumes with enabled data deduplication i recommend to schedule one “GarbageCollection” Job per night for the affected volume. You can schedule a job quite simple with the command: Set-DedupSchedule –Name "FreeSpace" –Type GarbageCollection –Start hh:ss –DurationHours 5 –Days Mon,Tues,Wed,Thurs,Fri,Sat,Sun –Priority High

Of course the execution time should not be at the same time like a large backup job or similar.. 🙂 Replace hh:ss with the time you want to perform the job, also remove unwanted days if not needed.