Alleviating pressure caused by component store size


I just wanted to make you all aware of a new KB article myself and a couple of teammates put together around component store growth and remediation.  I wanted to have something short and to the point and I think a lot of you might find this more useful than sifting through the blog trying to piecemeal together the same information.  I’ll probably try to put together something a little more verbose here that goes more into the internals of some of this but I am busy working on a new project and dont have tons of time.  If you have any questions or comments about the material please ask them here.

http://support.microsoft.com/kb/2795190/EN-US

–Joseph


Comments (27)

  1. Anonymous says:

    I'm not sure where that KB went.  It was basically a collection of a lot of the information on my blog rolled into an all up troubleshooting KB if its the one I was thinking of.  I'll ask the internal publishing teams.

  2. Anonymous says:

    @xpclient

    updates can be slipstreamed and also removed (which is not possible with XP) from images. For Service packs it was disabled because the Updates must be fully configured to install a new SP. A fried and I developed the first Sp1 sliptreaming tool for Windows Vista Sp1 in 2007/8 so I know that MS added hacks to prevent slipstreaming.

    Switching between branches was a disaster in XP. NT5.x servicing is bad, I respect your feeling, because you don't have the knowledge of how nt6.x servicing works. Both have goog point but also bad points. But after all nt 6.x servicing is much better.

    The slower install time is caused by reading the registry and checking if the update is needed or not. In Windows 7 some fixes are integrated to lower WinSxS usage and speed up installation of updates. For Vista add net stop wuauserv to your script before installing the update. This dramatically speeds up update installation.

  3. Anonymous says:

    Found it, it was republished as:

    support.microsoft.com/…/EN-US

  4. Anonymous says:

    I know Joseph 🙁 But it's the ONLY way to really reduce the space usage and it makes sense to have a lower amount of packages which the servicing stack has to handle to avoid slowdowns.

  5. Anonymous says:

    Yes, thats the correct result.  Uninstalling the update in this case only moves the package to a staged state, meaning, its still on the disk in the event that you need it later (because possibly you remove the supersedent KB).  Eventually, the scavenger will remove the files like these.

  6. Anonymous says:

    @tester

    the files are removed later when the PC is idle. Also if you remove packages from an image, the files are still in the WIM and will be deleted after you installed the Windows.

    Wait a few minutes and the files are gone.

  7. Anonymous says:

    We both are because it's about context.  My hard link blog is talking about the mechanism's of hardlinks and how they are distributed throughout an NTFS volume, Steven's blog was written to attempt to explain how those links are counted and why the size of the component store appears much larger than it actually is (due to the way explorer counts hard links).   One is the mechanism, the other is the result.

    The idea of a "real" file is also contextual.  For explorer, any file and its hard links are counted as real files.  From an NTFS perspective, there is one "real" file with multiple references.  The real file in this case would be the location of last reference to the file when all other hard links have been deleted.

    For example, using advapi32.dll, it exists in the component store (Winsxs) and the system32 directory.  To the explorer process, this exists as two files and so its counted twice by explorer.  From an NTFS perspective, it's just a single file on the disk with two references.  NTFS will update it's file record when anything on the file has changed and the hard linking mechanism will update that file throughout the volume.

    –Joseph

  8. Anonymous says:

    @joseph

    Can you add the pnputil to remove older drivers from the driverstore (pnputil -e to view all drivers and pnputil -d oemXXX.inf to remvoe them)? This also reduces the size. For Windwos 8 it would be good to move the drivers out of the install.wim to the DVD and only install the drivers to the DriverStore for devices which are found on the current PC. Next time a new device is detected search on WU (like you shown in the other topic) for updates or insert the Windows 8 DVD/ISO.

    @xpclient

    the size if set by default to 75% in Windows 7:

    "Windows reserves disk space for hibernate in the hibernation file, which is named Hiberfil.sys. For Windows 7, the default size of the hibernation file is equal to 75 percent of the total physical memory on the system. For example, on a computer that has 2 GB of RAM, the default hibernation file size is 1.5 GB. "

    download.microsoft.com/…/HiberFootprint.docx

    old NT 5.x servicing was a disaster. Every pathday I had issues that updates were installed, but the files were not updated.

  9. Anonymous says:

    Thanks Drew;

    Good comments on both accounts, I'll see what I can do to have those added.

  10. Anonymous says:

    @Andre;

    Not a bad idea, but might be tough to implement, I'll add this to my list 🙂

    @Harry;

    The way we do it in Win7/2008R2 is on an interval where the processor has been at idle for a certain period, it will trigger the scavenger to run.  I'll look into the type, thanks!

  11. Anonymous says:

    My brother-in-law is a Microsoft Project Manager, so I hear more than I should.

    Investors wonder why Microsoft stock just floundered for years, while new companies and Google had so much success.

    Oracle stock ran from 15 to 35 during the past five years.

    Google stock ran from 380 to over 700 during the five year period

    Microsoft stock traded from 28.84 DOWN to a current price of 25 during the five years.

    Why? Microsoft is too soft. Their executives are soft as compared to associates and executives at Google, Oracle and other successful competitors that steal their secrets . . . build their own companies . . . and then sell them to Microsoft! I know. My brother-in-law, Peter Leonard, is a Project Manager at Microsoft, so I've seen first hand just how soft and lazy these guys can get, not to mention the "who cares" attitude. Not to mention talking too much and dragging projects out so long, that the competition is ready to go to market by the time Microsoft is ready to go to Beta.

    All Microsoft execs and managers care about is a cushy job, nice dining room with great benefits and tons of time off. And when they don't get enough time off, they create it. Yes, I kid you not, they create time off hours off and fun time. They have the benefits of working at home . . . or from a beach in the Islands or anywhere they please, as long as there is a phone and an Internet connection. Believe me, I've been on those trips when he was "working" on the beach, in the pool, sipping pina coladas and enjoying the life of leisure.

    If Larry Ellison caught one of his executives on a "working" day like this, he'd probably hang him from the top floor of the Oracle Building or from the mast of his sailing yacht, maybe even drag him behind his yacht as shark bait. But when he is really on the ball, he finds them a job at Microsoft.

    Look at all the time Microsoft has had to catch Google with a Search Engine. Their first attempt failed miserably. Second attempt was to buy Yahoo, but Ballmer bungled that with an ego as big as his head, and probably a hundred execs and managers below him advising him . . . we can do it better. How? On the beach? At home? In the hot tub? Now they have Bing. Well, Bing This, because Bing is a complete failure because of guys like my brother-in-law who are there for the benefits, and not willing to take any chances or come up with anything new that might rock the boat of their executives that care more about the security of their positions than the guys and gals below them.

    They talk about things they should not be talking about, so the competition can either leap frog them or incorporate their good ideas into their development, and avoid the mistakes made at Microsoft. I've heard things I should not have heard, so I'm sure others have. If you can't keep your trap shut at Microsoft, you've got problems.

  12. Anonymous says:

    I'll give you my perspective on this as an engineer supporting these types of issues for the last 13-14 yrs.  Both systems have their problems.  The old servicing mechanisms ended up with a lot more torn state systems than what we have seen in Vista ++ related installations.  Even as painful as the WSUS SP1 torn state issue was, it pales in comparison to some of the things I used to see.  So in that way the new mechanisms work better.

    However, the new servicing related stuff is a lot more complex which makes troubleshooting the installation issues a lot more difficult for us and for you.  So in that way it's bad.  I personally like it better as I see the OS evolve but thats just my opinion, obiviously everyone has their own opinions.

  13. Anonymous says:

    I want a tool running as scheduled task each month after the Patchday to check for superseded updates and remove them to keep the WinSxS folder as small as possible.

    Please create such an tool for us.

  14. Dean says:

    Your new KB article has a link in it:

    blogs.msdn.com/…/disk-space.aspx

    That blog posting seems to contradict what you said in an earlier posting here :

    blogs.technet.com/…/how-hard-links-work.aspx

    You said:

    "This is how the component store functions.  All operating system files are placed into organized subdirectories under the WinSXS directory.  When a role is added, we simply create a new links to the appropriate files, usually linking them to the System32 or SysWOW64 directories"

    The other guy says:

    "nearly every file in the WinSxS directory is a “hard link” to the physical files elsewhere on the system—meaning that the files are not actually in this directory. For instance in the WinSxS there might be a file called advapi32.dll that takes up >700K however what’s being reported is a hard link to the actual file that lives in the WindowsSystem32"

    So YOU say that the "actual real" files are in the WinSxS directory and from that directory hardlinks point OUT from that directory to other directories creating "virtual files".

    HE says that the WinSxS directory only contains hard links ( virtual files ) and the "actual real" files are in all of the other directories.

    So who is correct ?

  15. Drewfus says:

    Hi Joseph.

    It’s a useful article. Thanks. My two bits worth…

    * Adding the following links via the exe names would be helpful.

    Windows Vista or Windows Server 2008 Service Pack 1: VSP1CLN.EXE
    msdn.microsoft.com/…/cc709655.aspx

    Windows Vista or Windows Server 2008 Service Pack 2: Compcln.exe
    technet.microsoft.com/…/dd335037(WS.10).aspx

    Windows 7 or Windows Server 2008 R2 Service Pack 1: DISM /online /Cleanup-Image /SpSuperseded or Disk Cleanup Wizard (cleanmgr.exe)

    blogs.technet.com/…/how-to-reclaim-space-after-applying-service-pack-1.aspx
    I used your post for the DISM command because the switches are missing from this reference;

    technet.microsoft.com/…/dd744311(v=WS.10).aspx
    . For Cleanupmgr.exe;
    support.microsoft.com/…/315246
    (XP command line) and/or
    support.microsoft.com/…/en-us
    (reclaim space -XP & WS2008).

    * If Vista SP2 is installed (to machine running SP1), does Compcln.exe remove both superseeded by SP1 and SP2 files, or is it necessary to also run vsp1cln.exe after installing SP1 but before installing SP2?

    * "Disable hibernation on the system". It would of course be preferable in some cases if hiberfil.sys could be moved from the boot partition, to a data partition.

    forum.sysinternals.com/change-location-of-hiberfilsys_topic26183.html

  16. Harry Johnston says:

    How often, or under what circumstances, is scavenging performed automatically on Windows 7?

    Typo: the sentence beginning "NOTE: Scavenging is performed automatically on Windows 7" does not have a full stop.  (Or is part of the sentence missing?)

  17. tester says:

    Example – system with both kb2548120 and kb2549079 installed.  I think the latter supercedes the former.  Performed an uninstall with WUSA /uninstall /kb:2548120.  Uninstall is successful, reboot.  DISM /Get-Packages no longer shows kb2548120.

    But … the kb2548120 migUiControls.dll 21725 still exist in winSxS, hence no reduction in disk consumption.  Is this the correct result?  Thanks.

  18. tester says:

    thanks!  a tool/script to uninstall (or least list) the superceded hotfixes would be great!

  19. xpclient says:

    I appreciate the effort for the article and I am also thankful for how you patiently handle comments here but please please please change the design for Windows 8 to require very minimum amount of space. As a user, I am ready to make any tradeoffs like not being able to uninstall or revert hotfixes at the cost of less disk space consumed. Also, there needs to be a way to install packages unattended but with a visual progress bar. XP's Package Installer (update.exe) was perfect and Vista ruined every single aspect of it. I am actively persuading anyone and everyone I know with an SSD to completely avoid Windows 7 and Vista (even though W7 includes improvements like TRIM support) just because of the bloated servicing store. I am expecting and looking forward to major improvements in Windows 8 for servicing so we can have the best of update.exe's features and Vista's package manager.

  20. xpclient says:

    The hibernation file can also be compressed in Windows 7 as documented in this article (download.microsoft.com/…/HiberFootprint.docx). I have 6 GB of RAM and on Windows 7, setting it to 60% does not cause any issues when resuming and saves some disk space.

  21. xpclient says:

    I beg to differ. I find NT 6.x servicing is a disaster. Systems being unable to boot because of failed and stuck at stage 3 updates, slow installing of updates, growing disk space, inability to slipstream, slow logon and logoff because Windows has to "configure" updates. On the contrary, I had no issues with NT 5.x servicing. Maybe you have disabled Windows File Protection or changed some system settings that is causing files to not get updated.

  22. xpclient says:

    @Andre.Ziegler, On almost all of the systems I patch where I download the updates and deploy them using custom scripts, all the scripts that use Package installer (Hotfix.exe) finish in a jiffy and the ones that use Package Manager (pkgmgr.exe) or wusa.exe take hours to complete. I had to insert "time /t" commands on all the scripts that use package manager because of the time it takes to install.

  23. xpclient says:

    @Andre.Ziegler, I understand how NT 6.x servicing works, thanks for your insults. XP does not have image-based servicing at all so yes offline servicing is an improvement in Vista, and probably the only good feature of NT 6.x servicing. On XP, you can choose which branch to install, with NT 6.x updates, you can't. You offer no objective reasons to convince me NT 5.x servicing is "bad". For me, NT 6.x servicing is a step back in update installation and system logon/logoff performance, reliability, disk footprint, and service pack slipstreaming. To each his own I guess.

  24. xpclient says:

    @Andre.Ziegler, just to confirm, you recommend that turning off the Automatic Updates service when installing locally downloaded updates one after the other via a script will speed up installation? I will try that certainly.

  25. Drewfus says:

    @xpclient: "Also, there needs to be a way to install packages unattended but with a visual progress bar."

    What if it were possible to pipe the log file to the console? (DPInst.exe can do this with it's /C switch.) Would that be acceptable? Btw, sometimes if i'm copying lots of small files i'll make my own "progress bar" by running 'mode con: lines=1', before running Robocopy. This does decrease total time but still allows an observer to monitor the operation. Imagine running Wusa.exe by specifying:

    > cmd /c "mode con: lines=2&title Installing KB123456…&wusa KB123456.msu /quiet /norestart /logfile:%temp%KB123456.txt /C"

    @Andre.Zeigler: "For Vista add net stop wuauserv to your script before installing the update. This dramatically speeds up update installation."

    Why does this help? Only for Vista?

  26. tam says:

    It also takes about 5 seconds off the boot time (I was hoping for more).

  27. NickViz says:

    Hello,

    where is the KB2592038? It's not available on MS site…