Windows image restore tool

DISM: проверка и восстановление системных компонентов образа Windows 10

Для проверки целостности системных файлов и восстановления поврежденных файлов (библиотек) компонентов в Windows (Windows Server) можно использовать команды SFC и DISM (Deployment Image Servicing and Management). Данные утилиты могут быть крайне полезными, если операционная система Windows работает нестабильно, появляются ошибки при запуске стандартных приложений или служб, после вирусного заражения и т.д.

Утилита DISM включена в состав Windows, начиная с Vista и может быть использована во всех поддерживаемых версиях начиная с Windows 7/Windows Server 2008 R2 (есть ограничения) заканчивая последними билдами Windows 10 / Windows Server 2019. В этой статье мы рассмотрим, как использовать утилиты DISM и SFC для проверки и восстановления целостности образа и системных файлов Windows 10.

SFC /scannow: Проверка и восстановление системных файлов Windows

Утилиту DISM для восстановления Windows обычно рекомендуется использовать после утилиты проверки целостности системных файлов SFC (System File Checker). Команда sfc /scannow сканирует защищенные системные файлы Windows, и, если они отсутствуют или повреждены, попробует восстановить их оригинальные копии из хранилища системных компонентов Windows (каталог C:\Windows\WinSxS).

Если команда sfc /scannow возвращает ошибку “ Программа защиты ресурсов Windows обнаружила повреждённые файлы, но не может восстановить некоторые из них / Windows Resource Protection found corrupt files but was unable to fix some of them ”, скорее всего утилита не смогла получить необходимые файла из хранилища компонентов (образа) Windows.

В этом случае вам нужно попробовать восстановить хранилище компонентов (ваш образ Windows) с помощью DISM.

После восстановления образа вы можете повторно использовать утилиту SFC для восстановления системных файлов.

DISM /RestoreHealth: Восстановление хранилища компонентов образа Windows

Для сканирования образа Windows на наличие ошибок и их исправления используется параметр DISM /Cleanup-image . Рассмотренные ниже команды выполняются в командной строке, запущенной с правами администратора.

Чтобы проверить наличие признака повреждения хранилища компонентов образа Windows (флага CBS) , который выставил один из системных процессов, выполните следующую команду (не применимо к Windows 7/Server 2008R2):

DISM /Online /Cleanup-Image /CheckHealth

При запуске этой команды не выполняется сканирование хранилища, проверяются лишь записанные ранее значения и события в журнале Windows. Изменения не вносятся. Команда проверит, не помечен ли образ как поврежденный и возможно ли устранить данное повреждение.

В этом примере команда вернула, что с образом все хорошо:

No component store corruption detected.
The operation completed successfully.

DISM /Online /Cleanup-Image /ScanHealth – выполнить полное сканирование хранилища компонентов на наличие повреждений в системных образа Windows (выполняется довольно долго от 10 до 30 минут).

Если команда /ScanHealth возвращает ошибки:

  • Хранилище компонентов подлежит восстановлению (The component sore is repairable);
  • Ошибка: 1726. Сбой при удалённом вызове процедуры;
  • Ошибка: 1910. Не найден указанный источник экспорта объекта.

Это однозначно говорит о том, что ваш образ Windows 10 поврежден и его нужно восстановить.

Чтобы исправить ошибки, автоматически скачать и заменить файлы повреждённых или отсутствующих компонентов эталонными версиями файлов (библиотек) из центра обновлений Windows (на компьютере должен быть доступ в Интернет), выполните:

DISM /Online /Cleanup-Image /RestoreHealth

Процесс сканирования и восстановления компонентов может быть довольно длительным (30 минут или более).

Если восстановление выполнится успешно, появится сообщение:

Восстановление выполнено успешно. Операция успешно завершена.
The restore operation completed successfully. The operation completed successfully.

Если на компьютере (сервере) отсутствует доступ в Интернет или отключена служба Windows Update, то при восстановлении хранилища компонентов появляются ошибки вида:

  • 0x800f0906 — Не удалось скачать исходные файлы. Укажите расположение файлов, необходимых для восстановления компонента, с помощью параметра Источник (0x800f0906 — The source files could not be downloaded. Use the source option to specify the location of the files that are required to restore the feature);
  • Ошибка: 0x800f0950 — Сбой DISM. Операция не выполнена (0x800f0950 — DISM failed. No operation was performed);
  • Ошибка: 0x800F081F. Не удалось найти исходные файлы. Укажите расположение файлов, необходимых для восстановления компонента, с помощью параметра Источник (Error 0x800f081f, The source files could not be found. Use the «Source» option to specify the location of the files that are required to restore the feature).
Читайте также:  Виртуальный маршрутизатор для windows

Вы можете указать WIM или ESD файл с оригинальным установочным образом Windows, который нужно использовать в качестве источника для восстановления файлов компонентов системы. Предположим, вы смонтировали установочный ISO образ Windows 10 в виртуальный привод E:. Для восстановления хранилища компонентов из образа используйте одну из команд:

DISM /online /cleanup-image /restorehealth /source:E:\sources\install.wim
Или:
DISM /online /cleanup-image /restorehealth /source:E:\sources\install.esd

Чтобы запретить использовать центр обновлений Windows в Интернете, и выполнять сканирование и восстановление образа Windows только из локального WIM/ESD файла:

DISM /online /cleanup-image /restorehealth /source:E:\sources\install.wim /limitaccess
Или:
DISM /online /cleanup-image /restorehealth /source:E:\sources\install.esd /limitaccess

dism /online /cleanup-image /restorehealth /limitaccess

Журнал сканирования и восстановления системных файлов утилиты DISM можно найти здесь: C:\Windows\Logs\CBS.log .

После восстановления хранилища компонентов вы можете запустить утилиту проверки системных файлов sfc /scannow . Скорее всего она успешно восстановит поврежденные файлы (Программа защиты ресурсов Windows обнаружила поврежденные файлы и успешно их восстановила).

Восстановление поврежденного хранилища компонентов Windows 10/Server 2016 с помощью PowerShell

В версии PowerShell в Windows 10 и Windows Server 2016/2019 есть аналоги рассмотренных выше команд DISM. Для сканирования хранилища компонентов и поиска повреждений в образе выполните:

Repair-WindowsImage -Online –ScanHealth

Если ошибок в хранилище компонентов не обнаружено, появится сообщение:

ImageHealth State: Healthy

Для запуска восстановления системных компонентов и файлов наберите:

Repair-WindowsImage -Online -RestoreHealth

Repair-WindowsImage -Online -RestoreHealth -Source E:\sources\install.wim:1

Где, 1 – индекс используемой у вас редакции Windows из WIM или ESD файла (список редакций Windows в WIM файле можно вывести так: Get-WindowsImage -ImagePath «E:\sources\install.wim» ).

Восстановление хранилища компонентов оффлайн если Windows не загружается

Если Windows не загружается корректно, вы можете выполнить проверку и исправление системных файлов в оффлайн режиме.

  1. Для этого загрузитесь с установочного (загрузочного диска) и на экране начала установки нажмите Shift + F10
  2. Чтобы разобраться с буквами дисков, назначенных в среде WinPE, выполните команду diskpart -> list vol (в моем примере диску, на котором установлена Windows присвоена буква C:\, эту букву я буду использовать в следующих командах);
  3. Проверим системные файлы и исправим поврежденные файлы командой: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
  4. Для исправления хранилища компонентов используйте следующую команду (в качестве источника для восстановления компонентов мы используем WIM файл с установочным образом Windows 10, с которого мы загрузили компьютер):
    Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim
  5. Если на целевом диске недостаточно места, то для извлечения временных файлов нам понадобится отдельный диск достаточного размера, например F:\, на котором нужно создать пустой каталог: mkdir f:\scratch и запустить восстановление хранилища компонентов командой:
    Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /ScratchDir:F:\scratch

Repair a Windows Image

Repair a Windows image using DISM. You can repair offline Windows image in a WIM or VHD file, or an online Windows image. An online Windows image will also attempt to repair itself if it becomes unserviceable. The repair source for this operation is the same source that is used for Features on Demand and is determined by Group Policy settings. For more information, see Configure a Windows Repair Source. When you use the DISM tool to repair an online or offline image, you can use the /Source argument with the /RestoreHealth argument to specify additional repair source locations to use to search for the required files.

For a quick check of an online image, you may be able to use the command: sfc /scannow to scan and repair files.

For a more extensive check that can repair issues with the store, use DISM /Cleanup-Image .

To check if an image is repairable

Scan the image to check for corruption. This operation will take several minutes. For example, at a command prompt, type the following command:

Check the image to see whether any corruption has been detected. For example, at a command prompt, type:

When you use the /CheckHealth sfc argument, the DISM tool will report whether the image is healthy, repairable, or non-repairable. If the image is non-repairable, you should discard the image and start again. If the image is repairable, you can use the /RestoreHealth argument to repair the image.

Читайте также:  Arch linux windows boot

To repair an image

Use the /RestoreHealth argument to repair the image. For example, to repair an offline image using a mounted image as a repair source, at a command prompt, type the following command:

Or to repair an online image using some of your own sources instead of Windows Update, type:

If you do not specify a /Source for the repair files, the default location for Features on Demand is used. For more information, see Configure a Windows Repair Source. If you specify more than one /Source, the files are copied from the first location where they are found and the rest of the locations are ignored. You can use /LimitAccess to prevent the DISM tool from using Windows Update as a repair source or as a backup repair source for online images.

Repairing images during servicing

In some cases, an image can be corrupted while modifying it with DISM. Use /Cleanup-MountPoints to repair it. This command will not unmount images that are already mounted, nor will it delete images that can be recovered using the /Remount-Image command.

Back up and restore your PC

To learn how to back up and restore individual files on a Windows-based computer:

To learn how to back up and restore in Windows 10:

Back up

There are several ways to back up your PC.

Select the Start button, then select Control Panel > System and Maintenance > Backup and Restore.

Do one of the following:

If you’ve never used Windows Backup before, or recently upgraded your version of Windows, select Set up backup, and then follow the steps in the wizard.

If you’ve created a backup before, you can wait for your regularly scheduled backup to occur, or you can manually create a new backup by selecting Back up now.

If you’ve created a backup before, but want to make a new, full backup rather than updating the old one, select Create new, full backup, and then follow the steps in the wizard.

Note: Do not back up files to the same hard disk that Windows is installed on. For example, do not back up files to a recovery partition. Always store media used for backups (external hard disks, DVDs, or CDs) in a secure place to prevent unauthorized people from having access to your files; a fireproof location separate from your computer is recommended. You might also consider encrypting the data on your backup.

Create a system image

System images contain all of the info on your PC at a particular state.

Right-click the Start button, then select Control Panel > System and Maintenance > Backup and Restore.

In the left pane, choose Create a system image, and then follow the steps in the wizard. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

Note: To create a system image of a drive, it must be formatted to use the NTFS file system. If you save the system image on a hard drive or USB flash drive, it must be formatted to use the NTFS file system.

Keeping different versions of system images

You can keep several versions of system images. On internal and external hard drives, older system images will be deleted when the drive runs out of space. To help conserve disk space, delete older system images.

If you’re saving your system images in a network location, you can only keep the most current system image for each computer. System images are saved in the format of drive\WindowsImageBackup\computer name\. If you already have a system image for a computer and are creating a new one for the same computer, the new system image will overwrite the old one.

If you want to keep the old system image, you can copy it to a different location before creating the new system image by following these steps.

Navigate to the location of the system image.

Читайте также:  Linux mint как удалить систему

Copy the WindowsImageBackup folder to a new location.

Create a restore point

You can use a restore point to restore your computer’s system files to an earlier point in time. Restore points are automatically created each week by System Restore and when your PC detects change, like when you install an app or driver.

Here’s how to create a restore point.

Right-click the Start button, then select Control Panel > System and Maintenance > System.

In the left pane, select System protection.

Select the System Protection tab, and then select Create.

In the System Protection dialog box, type a description, and then select Create.

Restore

Right-click the Start button, then select Control Panel > System and Maintenance > Backup and Restore.

Do one of the following:

To restore your files, choose Restore my files.

To restore the files of all users, choose Restore all users’ files.

Do one of the following:

To look through the contents of the backup, select Browse for files or Browse for folders. When you’re browsing for folders, you won’t be able to see the individual files in a folder. To view individual files, use the Browse for files option.

To search the contents of the backup, select Search, type all or part of a file name, and then select Search.

Tip: If you’re searching for files or folders associated with a specific user account, you can improve search results by typing the location of the file or folder in the Search for box. For example, to search for all JPG files that were backed up, type JPG in the Search for box. To only search for JPG files associated with the user Bill, type C:\Users\Bill\JPG in the Search for box. Use wildcard characters such as *.jpg to search for all JPG files that were backed up.

Restore a backup made on another computer

You can restore files from a backup that was created on another computer running Windows Vista or Windows 7.

Select the Start button, then select Control Panel > System and Maintenance > Backup and Restore.

Choose Select another backup to restore files from, and then follow the steps in the wizard. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

Find files that were restored from a backup made on another computer

If you’re restoring files from a backup that was made on another computer, the files will be restored in a folder under the user name that was used to create the backup. If the user names are different, you’ll need to navigate to the folder where the files are restored. For example, if your user name was Molly on the computer that the backup was made on but your user name is MollyC on the computer that the backup is being restored on, the restored files will be saved in a folder labelled Molly.

To find restored files:

Select the Start button, then select Computer.

Double-click the icon of the drive that the files are saved on, for example C:\.

Double-click the Users folder. You will see a folder for each user account.

Double-click the folder for the user name that was used to create the backup. The restored files will be in the various folders based on where they were located originally.

Restore files from a file backup after restoring your computer from a system image backup

After you restore your computer from a system image backup, there may be newer versions of some of your files in a file backup that you want to restore.

To restore files from a file backup that was created after the system image backup was created, follow these steps.

Select the Start button, then select Control Panel > System and Maintenance > Backup and Restore.

Choose Select another backup to restore files from. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

In Backup Period, select the date range of the backup that contains the files that you want to restore, and then follow the steps in the wizard.

Оцените статью