Winsxs windows server 2008 r2 очистка

Windows Server 2008 R2Как известно, папка winsxs, располагающаяся в системном каталоге Windows, используется этими операционными системами для хранения старых версий файлов для отката к ним в случае неудачного обновления системы. Со временем папка способна разрастись до нескольких десятков гигабайт, что может быть критично для старых серверов с небольшими жесткими дисками или для виртуальных серверов. Чистить эту папку вручную крайне не рекомендуется, а встроенный механизм очистки компания Microsoft ввела не сразу. К числу «пострадавших»систем относится Windows Server 2008 R2.

В сущности, есть два, скажем так, «законных» пути очистки папки winsxs, которые могут гарантировать Вам, что операционная система сохранит работоспособность. Это встроенная утилита Очистка диска и консольная утилита DISM.exe. Нюанс, однако, в том, что утилита Очистка диска не сразу обзавелась функцией чистки папки winsxs, понадобится установить KB2852386. Кроме того, в данных серверных ОС компания Microsoft скрыла утилиту очистки от пользовательских глаз. А вот использовать для этих целей в Windows Server 2008 R2 DISM.exe и вовсе нельзя. Виной тоже старая версия утилиты, в которой нет такой функции.

Как очистить папку winsxs в Windows Server 2008/2008 R2

Утилита очистки диска по умолчанию недоступна в Windows Server 2008 R2.

Поэтому первым делом проверяем, установлено ли в системе KB2852386, и, если нет, ставим его. Потребуется перезагрузить сервер.

Как очистить папку winsxs в Windows Server 2008/2008 R2

После этого нам нужно добавить компонент, который включает в Windows Server 2008 R2 утилиту очистки диска и некоторые другие возможности Windows 7. Собственно, как видим, первоначально возможности очищать папку winsxs не было и у владельцев Windows 7, но, если те своевременно обновляют свою операционную систему, то она уже давно есть. А вот в Windows Server 2008 R2 её надо дополнительно включать. Делается это через Диспетчер сервера, раздел Компоненты.

Как очистить папку winsxs в Windows Server 2008 R2

Нужный нам компонент называется Возможности рабочего стола (Desktop Experience в английской версии). Отмечаем его галочкой и нажимаем Далее.

Как очистить папку winsxs в Windows Server 2008 R2

Подробнее об этом компоненте можно прочитать здесь.

Учтите, что после включения компонента потребуется перезагрузка сервера. Об успешной установке будет свидетельствовать такое окно:

Как очистить папку winsxs в Windows Server 2008 R2

Теперь в меню Пуск можно будет наблюдать нужную нам утилиту.

Как очистить папку winsxs в Windows Server 2008 R2

Теперь Вы можете освобождать дисковое пространство на сервере таким же способом, как на любой рабочей станции.

Как очистить папку winsxs в Windows Server 2008 R2

First published on TechNet on May 13, 2014

It’s finally here! After pages and pages of comments from you requesting the ability to clean up the WinSxS directory and component store on Windows Server 2008 R2, an update is available.

http://support.microsoft.com/kb/2852386

As a refresher, the Windows Server 2008 R2 update is directly related to my previous blog post announcing a similar fix for Windows 7 client .

The Windows 7 version of this fix introduced an additional option to the Disk Cleanup wizard that would cleanup previous versions of Windows Update files. KB2852386 adds a Disk Cleanup option on Windows Server 2008 R2, similar to the Windows 7 update.

What does this mean for Windows Server 2008 R2? After installing this update and prior to being able to perform the cleanup, the Desktop Experience feature must be installed. Why you ask? Disk Cleanup is not installed by default on Windows Server 2008 R2. It is instead a component installed with the Desktop Experience feature.

Why was the update not included as a DISM switch like Windows Server 2012 R2?

This was evaluated, however, due to the amount of changes required and the rigorous change approval process, it was not feasible to back port the functionality this way. Knowing that it would be some time before everyone could upgrade to Windows Server 2012 R2 and based on feedback from an internal survey taken of a subset of enterprise customers, it was determined that this update would still be useful in its Disk Cleanup form, even with the Desktop Experience prerequisite. We hope you agree. However, we are aware that for some of you, the Desktop Experience requirement will be a deal breaker, but decided to release it anyway hoping it will help in some instances.

How can I get the update?

The update is available on Windows Update. It can also be manually downloaded from the Microsoft Update Catalog . The KB article listed above will also direct you to a download link in the Microsoft Download Center.

Let’s Cleanup those Old Windows Update Files!

First, let’s take a look at our starting point. Looking at my Windows 2008 R2 Server with SP1 installed, according to Windows Explorer, the size of my Windows/WinSxS directory is as follows:

The size of the WinSxS directory will vary by server. Some of you will have smaller WinSxS directories, some larger.

Installing the update is just like installing any other update. Just download and double-click on the .msu file:

Installing the update does not require Desktop Experience to be installed beforehand, but if you check your WinSxS directory again, you’ll see there has been no change to the size. This is expected as we need to run Disk Cleanup in order for this to take effect. It also does not require a reboot to install the hotfix.

But…we can’t do anything with what we just installed until we get Disk Cleanup which is installed with the Desktop Experience feature.

When installing Desktop Experience, it does require additional features. Select the button to Add Required Features and click Next and then Install:

A reboot is required to finalize the install.

Click Close and Reboot when prompted.

After we reboot, a Disk Cleanup option can be found under Start —> All Programs —> Accessories —> System Tools:

On launch, Disk Cleanup prompts for the drive you want to clean up:

After clicking Ok, a scan is performed:

Several options are provided for cleanup, including a new option for Windows Update Cleanup:

Just like the Windows 7 cleanup, mileage will vary. Also like Windows 7, the actual cleanup occurs during the next reboot. After the reboot, taking a look at the WinSxS directory, it has shrunk to the following:

Automation

My super knowledgeable scripting cohort Tom Moser wrote a PowerShell script that automates THE ENTIRE PROCESS. Can I get a cheer? Ok. So maybe it is a bit much to expect IT admins to cheer, but can I get an appreciative grunt?  The script certainly beats the alternative of doing this all manually.

You can find the script on the TechNet Script Center here:

http://gallery.technet.microsoft.com/scriptcenter/CleanMgrexeKB2852386-83d7a1ae

What does the script do?

In short, the script does the following:

1) Installs Desktop Experience, if not previously installed, and performs a reboot.

2) Sets the appropriate registry keys to automate the cleanup. The script will cleanup not only previous Windows Update files as well as Service Pack files.

3) The script then initiates the cleanup.

4) If Desktop Experience was not previously installed, the script uninstalls it.

5) Performs final reboot.

For more details, read below.

The script can be run from any directory on the server. It has two parameters: LogPath and a switch called NoReboot. LogPath will allow the user to specify a log location or if none is specified, by default, the script will create a log in the same directory from which the script was executed. NoReboot allows the user to suppress reboots, but will require manual reboots by an administrator.

Note : Make sure to check the log file to verify the process completed successfully and to verify there is no manual interaction required. If the script has completed successfully, the log will end with CleanMgr complete .

The script has several phases, using a registry key to keep track of progress. After initial run, it inserts itself as a scheduled task, which runs as local system. The final phase removes the task.

Depending on pending reboots, etc, we have found that this phase may generate a few reboots. Do not be concerned if the server reboots a few times.

Other Options

Aside from the cleanup mechanism included with this fix, if you have applied SP1 and have not cleaned up afterwards, I’d highly recommend doing so by running the following command from an administrative command prompt:

dism /online /cleanup-image /spsuperseded

or

If you have installed the Desktop Experience feature and thus have the Disk Cleanup utility, you can select the following option to do the same thing:

Specifying the /spsuperceded switch or choosing to remove service pack backup files will remove the ability to uninstall the service pack. If you haven’t done it before, it is certain to free up some space.

The Origins of this Update (Hint: Windows Server 2012 R2)

I’ve mentioned a couple of times that this is a back port. What does that mean? Well, it means that this functionality is already built into a later operating system. In this case, that operating system is Windows Server 2012 R2. Not only do we have several mechanisms to automatically cleanup previous versions of Windows Update files like this update does, we even have the ability to more accurately determine the size of the component store (aka the WinSxS directory).

The command to accurately determine the size of the component store on Windows Server 2012 R2 is as follows:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

Running this command analyzes the component store to determine the size and whether cleanup is recommended. Notice in the screen shot that it provides you with the Windows Explorer reported size and the actual size:

Notice that the component store is much smaller than Windows Server 2008 R2 right out of the gate? This isn’t because I’ve used Features on Demand to remove roles and features. It’s because by default in Windows Server 2012 R2, we compress all unused binaries. Another win for Windows Server 2012 R2!

Looking at the breakdown of the 5.12GB. We see that Shared with Windows accounts for 3.83GB of the 5.12GB. Shared with Windows refers to the size of the files that are hardlinked between the WinSxS directory and the Windows location of the file. Because these hardlinks appear to take up space, but don’t really, we can subtract them from our component store size. Therefore, the actual size of the component store is the total of Backups and Disabled Features plus Cache and Temporary Data or 1.28GB.

But back to our cleanup.

In the above screen shot, it’s stated that component store cleanup is recommended. We can manually cleanup the component store on Windows Server 2012 R2 by running the following command:

Dism.exe /online /Cleanup-Image /StartComponentCleanup

What does this do? When this runs, Windows cleans up the previous versions of the component that was updated. In other words, it is doing exactly what our update does for Windows Server 2008 R2 SP1. It removes previous versions of the files updated by Windows Updates.

After running /StartCompomentCleanup, upon analyzing the size again, we see it is as follows:

So no notable difference really. Largely because we’ve been running this cleanup all along. This same command is run every 30 days as a scheduled task with a time limit of 1 hour.

With the scheduled task however, the task will wait at least 30 days after an updated component has been installed before uninstalling the previous versions of the component. This scheduled task can be found in Task Scheduler under the Task Scheduler Library\Microsoft\Windows\Servicing\StartComponentCleanup directory:

More information on this can be found here: http://technet.microsoft.com/en-us/library/dn251565.aspx

If you’re in all out spring cleaning mode and want to perform super deep cleanup, you can use the /resetbase command with the /startcomponentcleanup to remove all superseded versions of every component in the component store:

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

This removes the ability to uninstall any updates applied until this point in time.

And don’t forget the ability to completely remove any role or feature which also reduces the size. Take a look at one of my earlier blogs for more details on Features on Demand: http://blogs.technet.com/b/askpfeplat/archive/2013/02/24/how-to-reduce-the-size-of-the-winsxs-direc…

Here’s a handy table showing when we introduced the various different cleanup and WinSxS size reductions by operating system:

Operating System Compress Unused WinSxS Binaries Cleanup Previous Windows Update Files Automatically Clean Up Previous Windows Update Files Cleanup All Components Features on Demand
Windows Server 2008 R2   With KB2852386      
Windows Server 2012 With KB2821895 x x   x
Windows Server 2012 R2 x x x x x

Want more information on how all this works under the covers?

Check out the following series on the AskCore team blog for an in-depth look at servicing improvements on Windows Server 2012 R2:

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

More on the Desktop Experience Feature

The Desktop Experience feature includes the following components and features:

* Windows Media Player

* Desktop themes

* Video for Windows (AVI support)

* Windows SideShow

* Windows Defender

* Disk Cleanup

* Sync Center

* Sound Recorder

* Character Map

* Snipping Tool

* Ink Support

Most of these are not automatically turned on with the exception of Windows Defender whose service is started after reboot. You’ll likely want to stop the service and disable it after reboot. Not all 3rd party anti-viruses conflict with Windows Defender, but there have been reports that some do.

~ Charity Shelbourne and Tom Moser, Spring cleaning servers since 1998

Update May 15th, 2014

We are aware of a method of copying in the appropriate Disk Cleanup/CleanMgr files into the appropriate location to avoid installing the Desktop Experience. If this were a tested and supported option, we certainly would have included these details in this post and definitely would have used this method to automate the cleanup. However, it was determined early on that this method would not be supported. If you decide to do this, do so at your own risk.

Windows Server 2008 R2

Как известно, папка winsxs, располагающаяся в системном каталоге Windows, используется этими операционными системами для хранения старых версий файлов для отката к ним в случае неудачного обновления системы. Со временем папка способна разрастись до нескольких десятков гигабайт, что может быть критично для старых серверов с небольшими жесткими дисками или для виртуальных серверов. Чистить эту папку вручную крайне не рекомендуется, а встроенный механизм очистки компания Microsoft ввела не сразу. К числу «пострадавших»систем относится Windows Server 2008 R2.

В сущности, есть два, скажем так, «законных» пути очистки папки winsxs, которые могут гарантировать Вам, что операционная система сохранит работоспособность. Это встроенная утилита Очистка диска и консольная утилита DISM.exe. Нюанс, однако, в том, что утилита Очистка диска не сразу обзавелась функцией чистки папки winsxs, понадобится установить KB2852386. Кроме того, в данных серверных ОС компания Microsoft скрыла утилиту очистки от пользовательских глаз. А вот использовать для этих целей в Windows Server 2008 R2 DISM.exe и вовсе нельзя. Виной тоже старая версия утилиты, в которой нет такой функции.

Как очистить папку winsxs в Windows Server 2008/2008 R2

Утилита очистки диска по умолчанию недоступна в Windows Server 2008 R2.

Поэтому первым делом проверяем, установлено ли в системе KB2852386, и, если нет, ставим его. Потребуется перезагрузить сервер.

Как очистить папку winsxs в Windows Server 2008/2008 R2

https://googleads.g.doubleclick.net/pagead/ads?guci=2.2.0.0.2.2.0.0&client=ca-pub-1580823735101673&output=html&h=280&adk=655554708&adf=3735666460&pi=t.aa~a.1381849204~i.9~rp.4&w=1200&fwrn=4&fwrnh=100&lmt=1606219025&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=2064693534&psa=0&ad_type=text_image&format=1200×280&url=https%3A%2F%2Fwebistore.ru%2Fadministrirovaniye-windows%2Fkak-ochistit-papku-winsxs-v-windows-server-2008-r2%2F&flash=0&fwr=0&pra=3&rh=200&rw=1303&rpe=1&resp_fmts=3&wgl=1&fa=27&adsid=ChEIgPvy_QUQr5S8ldGXns6rARI8AIWxez6SlhPrp7qHJjC19HevECTUuPvIT3-KvBygehQ0N60nGopHlJ—1a5XSXSym67s47jBxf5hHSRF&tt_state=W3siaXNzdWVyT3JpZ2luIjoiaHR0cHM6Ly9hZHNlcnZpY2UuZ29vZ2xlLmNvbSIsInN0YXRlIjowfSx7Imlzc3Vlck9yaWdpbiI6Imh0dHBzOi8vYXR0ZXN0YXRpb24uYW5kcm9pZC5jb20iLCJzdGF0ZSI6MH1d&dt=1606219025325&bpp=9&bdt=4553&idt=9&shv=r20201112&cbv=r20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3D13cb9afa9cf58d1f-22a45e5f44b9007c%3AT%3D1606219025%3ART%3D1606219025%3AS%3DALNI_Mab98Uo9vXBKJv63zSQZKtTcsShrw&prev_fmts=0x0%2C240x400%2C240x400%2C240x400%2C240x400&nras=2&correlator=3198616304908&frm=20&pv=1&ga_vid=509228968.1606219024&ga_sid=1606219024&ga_hid=1251847467&ga_fc=0&iag=0&icsg=174097148579&dssz=31&mdo=0&mso=0&u_tz=180&u_his=2&u_java=0&u_h=1080&u_w=1920&u_ah=1040&u_aw=1920&u_cd=24&u_nplug=4&u_nmime=7&adx=352&ady=1214&biw=1903&bih=940&scr_x=0&scr_y=0&eid=21066706&oid=3&pvsid=1382874204892476&pem=835&ref=https%3A%2F%2Fyandex.ru%2F&rx=0&eae=0&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1040%2C1920%2C940&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=8320&bc=31&jar=2020-11-19-09&ifi=5&uci=a!5&btvi=3&fsb=1&xpc=SzFh8bl6yq&p=https%3A//webistore.ru&dtd=157

После этого нам нужно добавить компонент, который включает в Windows Server 2008 R2 утилиту очистки диска и некоторые другие возможности Windows 7. Собственно, как видим, первоначально возможности очищать папку winsxs не было и у владельцев Windows 7, но, если те своевременно обновляют свою операционную систему, то она уже давно есть. А вот в Windows Server 2008 R2 её надо дополнительно включать. Делается это через Диспетчер сервера, раздел Компоненты.

Как очистить папку winsxs в Windows Server 2008 R2

Нужный нам компонент называется Возможности рабочего стола (Desktop Experience в английской версии). Отмечаем его галочкой и нажимаем Далее.

Как очистить папку winsxs в Windows Server 2008 R2

Подробнее об этом компоненте можно прочитать здесь.

Учтите, что после включения компонента потребуется перезагрузка сервера. Об успешной установке будет свидетельствовать такое окно:

Как очистить папку winsxs в Windows Server 2008 R2

Теперь в меню Пуск можно будет наблюдать нужную нам утилиту.

Как очистить папку winsxs в Windows Server 2008 R2

Теперь Вы можете освобождать дисковое пространство на сервере таким же способом, как на любой рабочей станции.

Как очистить папку winsxs в Windows Server 2008 R2

Большое спасибо за материал https://webistore.ru

Join @AdmNtsRu on Telegram

Смотрите также:

Table of Contents

  • Applied operating systems
  • Prerequisites
  • Procedures

Applied operating systems

Windows Server 2008 R2

Prerequisites

It is not recommended to delete the winsxs folder directly. Deleting this folder may cause BSOD error and OS may crash permanently.

  • Download and install the Windows Update Pack Windows6.1-KB2852386-v2-x64.msu from the below link:

     
    http://download.microsoft.com/download/2/A/3/2A3FD850-E45F-47D4-AFF8-8048333CBA7D/Windows6.1-KB2852386-v2-x64.msu

  • Disk cleanup utility

 The disk cleanup utility will be added by installing the Desktop Experience feature from Windows Server manager.

Procedures

Please follow the below procedures to install the desktop Experience feature

Step1: Go to server manager and select add features.

Step2: Select desktop Experience feature from the list and follow the installation.

Step3: When installing Desktop Experience, it does require additional features. Select the button to Add Required Features and click next and then Install.

  Step 4: A reboot is required to finalize the install.

  After reboot, a Disk Cleanup option can be found under Start —> All Programs —> Accessories —> System Tools:

On launch, Disk Cleanup prompts for the drive you want to clean up

Select the C drive and click OK.

Several options are provided for cleanup, including a new option for Windows Update Cleanup:

 

After preceding the cleanup a reboot is required to complete the cleanup process.

Here we will show one of the examples from the server USCHCVMP365AD08.us.na.ey.net

We were faced a disk space issue on this server which is showing only 19.1 MB free space on its C drive.

While checking the Winsxs folder, it consumes around 12 GB of size as shown in the below image:

While using the disk cleanup it showing around 4.71 GB of Windows update cleanup data.

After rebooting the server the winsxs folder consumed space reduced to 7.32 GB from 12 GB.

Category:

  • IT
  • Cancel

Не прошло и 5 лет, и у нас появился официально поддерживаемый способ очистки каталога %windir%\winsxs в Windows Server 2008 R2, портированный из 2012. Для серверов с дисками на 74Гб это может быть очень актуально, т.к. каталог легко может занимать 15-20Гб.
Для очистки надо:
1) Установить обновление KB2852386 (приходит через WSUS);
2) Установить фичу Desktop Experience (требует перезагрузки) — мастер очистки входит в неё;
3) Запустить мастер очистки (system Tools — Disk Cleanup), там выбрать Windows Update Cleanup и, если надо, Service Pack Backup Files.

Как не очень поддерживаемый способ, если нет возможности перезагрузки или места для установки, можно скопировать
cleanmgr.exe из C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da в %systemroot%\System32, и cleanmgr.exe.mui из C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63 в %systemroot%\System32\en-US (для английской версии).

Информация отсюда, обходное решение с копированием от Tom_Floor:
http://blogs.technet.com/b/askpfeplat/archive/2014/05/13/how-to-clean-up-the-winsxs-directory-and-free-up-disk-space-on-windows-server-2008-r2-with-new-update.aspx

PS Первая же перезагрузка сервера после очистки может оказаться очень, очень долгой, при этом будет выполняться часть работ по очистке.

  • Winretools windows 8 что это
  • Winsxs как очистить windows 2008 r2
  • Winreagent что это за папка в windows 10 можно ли удалить
  • Winstep nexus dock для windows 10 скачать
  • Winscp download for windows 10