{"id":1525,"date":"2013-04-14T15:16:04","date_gmt":"2013-04-14T15:16:04","guid":{"rendered":"https:\/\/pipe2text.com\/?p=1525"},"modified":"2013-04-15T01:18:42","modified_gmt":"2013-04-15T01:18:42","slug":"using-powershell-to-install-and-configure-deduplication-in-windows-server-2012","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=1525","title":{"rendered":"Using PowerShell to Install and Configure Deduplication in Windows Server 2012"},"content":{"rendered":"<p><a id=\"_GoBack\"><\/a>Hi All,<\/p>\n<p>A new feature included in Windows Server 2012 is data deduplication. Windows 2012 deduplication segments files into small chunks and stores any duplicate chunks as a single chunk to save on space. The chunks are between 32 and 128 KB in size. Data deduplication can only be enabled on\u00a0NTFS. Also, deduped drives cannot be system or boot volumes. Using the deduplication that is built into Windows Server 2012 can be a quick and easy way to clear up disk space depending on your needs.<\/p>\n<p>There is also a nice utility you can run called ddpeval.exe which can be run locally or against a remote server to see what you savings would be using deduplication before deploying.\u00a0I cover that topic in another blog that can be found <a title=\"Using the Data Deduplication Savings Evaluation Tool (ddpeval.exe) to Calculate Space Savings gained before deploying the Windows 2012 Deduplication Feature\" href=\"https:\/\/pipe2text.com\/?page_id=1511\">here<\/a>.<\/p>\n<p>To install deduplication on a Windows 2012 Server all you need to do is open PowerShell as Administrator and run the following command:<\/p>\n<p>Install-WindowsFeature FS-Data-Deduplication<\/p>\n<p>To enable Deduplication type the following command in PowerShell:<\/p>\n<p>Enable-DedupVolume e:<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image1.png\" \/><\/p>\n<p>The above command will enable data deduplication on the\u00a0E drive.<\/p>\n<p>If you want to get a list of volumes that have\u00a0deduplication enabled you can type:<\/p>\n<p>Get-DedupVolume<\/p>\n<p>If you want to also see the dedup settings and volume settings you can type the following:<\/p>\n<p>Get-DedupVolume | fl<\/p>\n<p>As you can see in the illustration below, you can get the settings such as &#8220;MinimumFileAgeDays&#8221; which is the amount of days since a file was last modified before it is deduped (Default is 5 days) and the &#8220;MinimumFileSize&#8221; (minimum size of a file which can be deduped) which is 32KB.\u00a0There is also an option for &#8220;ExcludeFolder&#8221; and &#8220;ExcludeFileType&#8221;.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image2.png\" \/><\/p>\n<p><strong>NOTE: If you set <\/strong><strong>MinimumFileAgeDays<\/strong><strong> to 0 days, it will<\/strong><strong> process all files no matter their age.<\/strong><\/p>\n<p>If you want to change the &#8220;MinimumFileAge&#8221; for instance, you could type the following command:<\/p>\n<p>Set-Dedupvolume E: -MinimumFileAgeDays 0<\/p>\n<p>To see the schedule for deduplication you can run the following command:<\/p>\n<p>Get-Dedupschedule<\/p>\n<p>To see detailed information about the schedule you can type the following command:<\/p>\n<p>Get-Dedupschedule | fl<\/p>\n<p>As you can see from the illustration below there are 3 job types.<\/p>\n<p>1. Optimization- Runs once an hour. This job deduplicates and compresses file chunks on the volume.<\/p>\n<p>2. Garbage Collection- Runs once a week. Removes any chunk files that are no longer referenced to reclaim space.<\/p>\n<p>3. Scrubbing- Runs once a week. Verifies data integrity and attempts to fix any corruption it finds.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image3.png\" \/><\/p>\n<p>You can also look in Windows Task Scheduler and you will see the 3 jobs set up under deduplication as shown below. One thing I noticed is that all 3 tasks were scheduled to start the next the morning following the date I enabled dedup. I enabled\u00a0deduplication on 4\/13\/2013 and all tasks where set to start on 4\/14\/2014.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image4.png\" \/><\/p>\n<p>After the background optimization runs for the first time, you can run the \u201cGet-DedupStatus\u201d cmdlet to see your dedup savings as shown below. I was able to recoup 5.24 GBs of space on my E drive. Remember, you may not see dedup savings right away depending on your &#8220;MinimumFileAgeDays&#8221; setting. To push thinks along and see the savings right away, I changed the MinimumFileAgeDays to 0 for the purposes of this example.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image5.png\" \/><\/p>\n<p>If you wanted to kick off a deduplication optimization job right away, you could type the following command:<\/p>\n<p>Start-DedupJob \u2013Volume E: \u2013Type Optimization<\/p>\n<p>You may have a case where you may want to run a Garbage collection job right away. One example would be if you were running dangerously low on the deduped volume and needed to clean up space by removing unused chunks. You could type the following command:<\/p>\n<p>Start-DedupJob \u2013Volume E: \u2013Type GarbageCollection \u2013full<\/p>\n<p>If you wanted to schedule additional jobs to run off hours let\u2019s say, you could use the &#8220;New-DedupSchedule&#8221; cmdlet. For example, you could run the command below to add an additional optimization job named &#8220;Additional Optimization Job&#8221; on Saturday and Wednesday evenings at 10 PM for a duration of no longer than 12 hours.<\/p>\n<p>New-dedupschedule -Name &#8220;Additional Optimization Job&#8221; -Type Optimization -Days Sat, Wed -Start 22:00 -DurationHours 12<\/p>\n<p>Successful completion of this command will display the output as shown below.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image6.png\" \/><\/p>\n<p>If you look in the Windows Task Scheduler you will see the new \u00a0job configured there under Deduplication as illustrated below.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/dedup2012\/image7.png\" \/><\/p>\n<p>I hope this helps. If you want more information on Windows Server 2012 Deduplication feature you can visit Microsoft\u2019s TechNet site. As always, if you have any questions or feedback, please leave a comment.<\/p>\n<p>Related Links:<\/p>\n<p><strong><a title=\"Using the Data Deduplication Savings Evaluation Tool (ddpeval.exe) to Calculate Space Savings gained before deploying the Windows 2012 Deduplication Feature\" href=\"https:\/\/pipe2text.com\/?page_id=1511\">Using the Deduplication Evaluation Tool (ddpeval.exe) to Calculate Space Savings Gained before deploying the Windows 2012 Deduplication Feature<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, A new feature included in Windows Server 2012 is data deduplication. Windows 2012 deduplication segments files into small chunks and stores any duplicate chunks as a single chunk to save on space. The chunks are between 32 and &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=1525\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-1525","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1525"}],"version-history":[{"count":15,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1525\/revisions"}],"predecessor-version":[{"id":1563,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1525\/revisions\/1563"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}