All Products
Search
Document Center

:Add a disk driver to a Windows instance in Recovery mode

Last Updated:Dec 30, 2020

Overview

This article describes how to add a disk driver to a Windows instance in Recovery mode.

Detail

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

Take the Windows Server 2012 R2 version as an example.

  1. In the run window of the Start menu, enter powershell and press the Enter key to quickly open Powershell.
  2. Use the following commands to specify the Winre path and the driver version corresponding to the system.
    $WinREFile = "C:\Recovery\WindowsRE\Winre.wim" ; $driverVersion = "win8"
    Note: Windows Server 2012 the previous version, you need to set up $driverversion="win7". For Windows Server 2012 and 2012 R2, set this parameter to built-in driverversion=win8 ". For Windows Server 2016 and later versions, set this parameter to built-in driverversion=win10".
  3. Run the following command to create a temporary Mount Directory:
    $MountPath = "C:\TempMount"; New-Item $MountPath -ItemType Directory
  4. Use the following command to obtain the driver file location.
    $DiskDriver = "C:\ProgramData\aliyun\vminit\kvm\${driverVersion}\${env:PROCESSOR_ARCHITECTURE}\viostor.inf"
  5. Run the following command to mount and install the disk driver:
    & Dism /Mount-Wim /WimFile:$WinREFile /Index:1 /MountDir:$MountPath
    & Dism /Image:$MountPath /Add-Driver /Driver:$DiskDriver /ForceUnsigned
    & Dism /Unmount-Wim /MountDir:$MountPath /commit

Application scope

  • Elastic Compute Service