What’s New in Windows Servicing: Part 1

What’s New in Windows Servicing: Part 1

  • Comments 19
  • Likes

My name is Aditya and I am a Senior Support Escalation Engineer for Microsoft on the Windows Core Team. I am writing today to shed some light on a the new changes that have been made to the Windows Servicing Stack in Windows 8.1 and Windows Server 2012 R2. This is a 4 part series:

What’s New in Windows Servicing: Part 1
What’s New in Windows Servicing: Reduction of Windows Footprint : Part 2
What’s New in Windows Servicing: Service Stack Improvements: Part 3

Windows 8.1 brings in a lot of new features to improve stability, reduce space usage and keep your machine up to date. This blog series will talk about each of these new features in detail and talk about some of the troubleshooting steps you will follow when you run into a servicing issue.

What is Servicing and The Servicing Stack: Windows Vista onwards use a mechanism called Servicing to manage operating system components, rather than the INF-based installation methods used by previous Windows versions. With Windows Vista and Windows Server 2008, component-based builds use images to deploy component stores to the target machine rather than individual files. This design allows installation of additional features and fixes without prompting for media, enables building different operating system versions quickly and easily, and streamlines all operating system servicing.

Within the servicing model, the update process for Vista+ Operating systems represents a significant advance over the update.exe model used in previous operating systems. Although update.exe had many positive features, it also had numerous issues, the foremost of which was the requirement to ship update.exe engine with each package.

Servicing is simplified by including the update engine, in the form of the servicing stack, as part of the operating system. The servicing stack files are located in the C:\Windows\WINSxs folder.

image

This folder can grow very large on Windows 2008 and Windows 2008 R2 system and more information can be found at why this happens at :

What is the WINSXS directory in Windows 2008 and Windows Vista and why is it so large?
http://blogs.technet.com/b/askcore/archive/2008/09/17/what-is-the-winsxs-directory-in-windows-2008-and-windows-vista-and-why-is-it-so-large.aspx

What’s new in Windows 8.1 and Server 2012 R2:

1. Component Store Analysis Tool:

A new feature has been added to the DISM command that will allow users to get detailed information on the contents of the Component Store (WinSxS folder).

There have been many users, mainly power users and IT Admins of Windows, who have raised concerns around the size of the WinSxS store and why it occupies so much space on the system. These users also have complaints about the size of WinSxS growing in size over time and are curious to know how its size can be reduced. A lot of users have questioned what happens if the WinSxS store is deleted completely. There have been multiple attempts in the past to explain what the WinSxS store contains and what the actual size of the WinSxS store is. For this OS release, a reporting tool has been created that a power user can run to find out the actual size of the WinSxS store as well as get more information about the contents of the Store. This is in addition to the article we will be publishing for users to understand how the WinSxS is structured, and what the actual size is as compared to the perceived size of this store.

The purpose of this feature is two-fold. First, is to educate power users and IT Admins of Windows about what WinSxS is, what it contains and its importance to the overall functioning of the OS. Second, this feature will deliver a tool via the DISM functionality to analyze and report a specific set of information about the WinSxS store for power users.

From various forums and blog posts, there seem to be two main questions that users have:

· Why is WinSxS so massive?

· Is it possible to delete WinSxS in part or completely?

In addition to this, OEMs do have questions about how they can clean up unwanted package store, servicing logs, etc. from the image.

Based on these questions, we felt that the most important metric for our tool would be the actual size of WinSxS. Secondly, it would be good to report packages that are reclaimable so that a user can startcomponentcleanup to scavenge them. Lastly, for devices like the Microsoft Surface, which remain on connected standby, it may be possible that the system never scavenged the image. In that case, considering that these tablets have small disk sizes, it becomes important to let users know when it was last scavenged and whether scavenging is recommended for their device.

We expect the amount of time for completion of the analysis to be somewhere between 40 and 90 seconds on a live system. In this scenario, there needs to be some indication of progress made visible to the user. We will use the existing progress UI of DISM to indicate the % of analysis completed to the user. The user will also get the option to cancel out of the operation through the progress UI.

The following steps describe the end to end flow of using the component store analysis tool:

· The user launches an elevated command prompt by typing Command Prompt on the Start screen.

· The user types in the DISM command:

Dism.exe /Online /Cleanup-image /AnalyzeComponentStore

At the end of the scan, the user gets a report of the results like this:

image

2. Component Store Cleanup:

The Component Store Cleanup functionality is one of several features aimed at reducing the overall footprint and footprint growth of the servicing stack. Reducing the footprint of Windows is important for many reasons, including providing end users more available disk capacity for their own files, and improving performance for deployment scenarios.

Component Store Cleanup in Windows 8 was integrated into the Disk Cleanup Wizard. It performs a number of tasks, including removing update packages that contain only superseded components, and compressing un-projected files (such as optional components, servicing stack components, etc.). For Windows 8.1, we will add the capability to perform deep clean operations without requiring a reboot.

Today, Component Store Cleanup must be triggered manually by an end-user, either by running DISM, or by using the Disk Cleanup Wizard. In order to make Component Store Cleanup more useful for the average end-user, it will be added into a maintenance task, automatically saving disk space for end-users. To enable this, a change will be made to allow uninstallation of superseded inbox drivers without requiring a reboot (today, all driver installs/uninstalls done by CBS require a reboot).

The superseded package removal feature of deep clean attempts to maintain foot print parity between a computer that has been serviced regularly over time vs. a computer that has been clean installed and updated.

2.1. How can Component Store Cleanup be initiated?

Component Store Cleanup will support being initiated in the below 3 ways:

1. Dism.exe /online /Cleanup-Image /StartComponentCleanup

clip_image002

2. Disk cleanup wizard :

a. To open Disk Cleanup from the desktop, swipe in from the right edge of the screen, tap Settings (or if you're using a mouse, point to the lower-right corner of the screen, move the mouse pointer up, and then click Settings), tap or click Control Panel, type Admin in the Search box, tap or click Administrative Tools, and then double-tap or double-click Disk Cleanup.

b. In the Drives list, choose the drive you want to clean, and then tap or click OK.

c. In the Disk Cleanup dialog, select the checkboxes for the file types that you want to delete, tap or click OK, and then tap or click Delete files.

d. To delete system files:

i. In the Drives list, tap or click the drive that you want to clean up, and then tap or click OK.

ii. In the Disk Cleanup dialog box, tap or click Clean up system files. clip_image003 You might be asked for an admin password or to confirm your choice.

clip_image005

c. In the Drives list, choose the drive you want to clean, and then tap or click OK.

d. In the Disk Cleanup dialog box, select the checkboxes for the file types you want to delete, tap or click OK, and then tap or click Delete files.

clip_image006

e. Automatic from a scheduled task:

i. If Task Scheduler is not open, start the Task Scheduler. For more information, see Start Task Scheduler.

ii. Expand the console tree and navigate to Task Scheduler Library\Microsoft\Windows\Servicing\StartComponentCleanup.

iii. Under Selected Item, click Run

clip_image008

The StartComponentCleanup task can also be started from the command line:

schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

For all three methods, an automatic scavenge will be performed after the disk cleanup in order to immediately reduce the disk footprint. When scavenge is performed for option 1, NTFS compression will not be used since it has a negative impact on capture and apply times, but Delta Compression will be used since it will help with both capture and apply. When run automatically for option 3, deep clean and the scavenge operation will be interruptible in order to maintain system responsiveness.

2.2. What does Component Store Cleanup do?

During automatic Component Store Cleanup, packages will be removed if the following criteria apply:

§ All components in package are in superseded state

§ Packages are not of an excluded class (permanent, LP, SP, foundation)

§ Package is older than defined age threshold

· Only packages that have been superseded for a specified number of days (default of 30 days) will be removed by the automated deep clean task. In order maintain user responsiveness automatic Component Store Cleanup will perform package uninstall operations one at a time, checking to see if a stop has been requested in between each package.

· The Component Store Cleanup maintenance task will be incorporated into the component platform scavenging maintenance task. This task runs every 1 week, with a deadline of 2 weeks. This ensures that scavenging and deep clean processing happens relatively quickly after patches are released on patch Tuesday.

Manual Component Store Cleanup

During manual Component Store Cleanup, packages will be removed if the following criteria apply:

· All components in package are in superseded state

· Packages are not of an excluded class (permanent, LP, SP, foundation)

The functionality for manual Component Store Cleanup largely already exists in Win8. To improve performance, manual deep clean will perform all package uninstall operations in a single KTM transaction, and is not interruptible. Superseded packages are not subject to an age limit. Instead they are removed immediately.

The next blog in the series we will discuss more about Delta Compression & Single Instancing…

Aditya
Senior Support Escalation Engineer
Microsoft Platforms Support

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Hi Aditya, Good Post can you explain the following the following terms (permanent, LP, SP, foundation)

  • Very nice explanation!! Looking forward for the series. Does the size of the winsxs folder changes when someone switches between Core, Full and Minimal server interface?

  • Hi Aditya, Great work , good explanation on how servicing works .. looking forward for more detailed version soon .. hope you will be explaining in details about servicing stack & how it works.

  • @Jaspreet LP: means a Language Pack SP: means a Service Pack Permanent & Foundation : Critical and Important packages, which are necessary for Windows and thus are excluded from cleanup

  • Hi Aditya, Thanks for the post. It's good to see someone filling the void we have after Joe Conway stopped posting about CBS. Delta compression is the most interesting part for me. I have several specific questions, and I do hope to see your answers in the comments or in the second part of the series. 1. I quote "When scavenge is performed for option 1, NTFS compression will not be used since it has a negative impact on capture and apply times, but Delta Compression will be used" If the option 1 is "Dism.exe /online /Cleanup-Image /StartComponentCleanup", why does NTFS compression begins right after it, as clearly displayed in the log you posted http://bit.ly/1bO3OO3 You just muddied the waters, sorry :) 2. Does Windows Explorer show Delta-compressed files in blue the same way it handles NTFS-compressed files? If not, how can one determine visually that a file is delta-compressed? 3. Is there a command line tool that performs Delta compression or displays its ratio like compact.exe with NTFS-compression? Can compact.exe show delta compression ratio? Thanks, Vadim

  • Oh, this commenting system is just pathetic, it removes all paragraphs. I guess it's aimed at people who can't post more than two sentences. Here's my previous post in readable format http://1drv.ms/1mcG2vX

  • Hi Vadim, For your Question (2) - Only files in the component store are compressed and if u navigate to some of the subfolders under Windows\WinSxS you will see these compressed files in blue. For a particular binary, you can also launch a powershell, navigate to Windows\WinSxS folder and run this cmdlet to find out : get-Childitem | Where Name -like '*acpi*' | Get-ChildItem | ft Name, Attributes For 3) There is no command that can tell you how much space will be saved per file/package after Delta compression. You can use dism's /AnalyzeComponentStore switch can do it for everything in the component store. For 1) Wait for the next couple of blogs in this series... ;-) Regards, Vimal

  • Hi Vadim, For your Question (2) - Only files in the component store are compressed and if u navigate to some of the subfolders under Windows\WinSxS you will see these compressed files in blue. For a particular binary, you can also launch a powershell, navigate to Windows\WinSxS folder and run this cmdlet to find out : get-Childitem | Where Name -like '*acpi*' | Get-ChildItem | ft Name, Attributes For 3) There is no command that can tell you how much space will be saved per file/package after Delta compression. You can use dism's /AnalyzeComponentStore switch can do it for everything in the component store. For 1) Wait for the next couple of blogs in this series... ;-) Regards, Vimal

  • Hi Vadim, For your Question (2) - Only files in the component store are compressed and if u navigate to some of the subfolders under Windows\WinSxS you will see these compressed files in blue. For a particular binary, you can also launch a powershell, navigate to Windows\WinSxS folder and run this cmdlet to find out : get-Childitem | Where Name -like '*acpi*' | Get-ChildItem | ft Name, Attributes For 3) There is no command that can tell you how much space will be saved per file/package after Delta compression. You can use dism's /AnalyzeComponentStore switch can do it for everything in the component store. For 1) Wait for the next couple of blogs in this series... ;-) Regards, Vimal

  • < Sorry about that, yeah the commenting facility is not very good, it pasted my comment thrice... :-p >

  • Hi Vimal! Appreciate your answers. 1) I'm thrilled :) 2) I'll rephrase. Is there a way to distinguish between NTFS- and Delta-compressed files, either in PowerShell or Explorer? 3) Hopefully #1 will make it more clear. Vadim

  • >>Delta compression is done for superseded components only - because they are no longer hard linked from WinSxS to other locations in the file system. //

    >>NTFS compression is used for drivers to reduce their space usage. Delta compression cant be used for these files as they may have been hard linked to other places in the file system. NTFS compression is same as the compression that you may enable by going into a file's Properties > Advanced > checking "Compress contents to save disk space."//

    >> Start component cleanup does a pass of both, Delta and NTFS compression.//

    >>The key difference is that after delta compression, the compressed file itself will only contain differences (deltas), there will always be a base file to which these differences will be combined with - to yield the actual file. The delta file hence will be much smaller in size.//

    >>Compression attribute is set for both cases, explorer and powershell wont really show a difference. I am not sure if there is a way to distinguish between them.//

  • Were there other issues with the update.exe engine in versions of Windows prior to Vista?