排查 Azure VM 备份的文件恢复问题Troubleshoot issues in file recovery of an Azure VM backup

本文提供的故障排查步骤可帮助你解决从 Azure 虚拟机 (VM) 备份恢复文件和文件夹时出现的问题。This article provides troubleshooting steps that can help you resolve problems recovering files and folders from an Azure virtual machine (VM) backup.

常见错误消息Common error messages

本部分提供了针对可能出现的错误消息的故障排除步骤。This section provides steps to troubleshoot error messages that you might see.

“连接到目标时捕获到异常”"Exception caught while connecting to target"

可能的原因:脚本无法访问恢复点。Possible cause: The script is unable to access the recovery point.

建议的操作:若要解决此问题,请按脚本运行但连接失败中列出的步骤进行操作。Recommended action: To resolve this issue, follow the steps listed in The script runs but the connection failed.

“已经通过 iSCSI 会话登录目标”"The target has already been logged in via an iSCSI session"

可能的原因:脚本已在同一台计算机上运行,并且已附加驱动器。Possible cause: The script was already run on the same machine and the drives have been attached.

建议的操作:已附加恢复点所在的卷。Recommended action: The volumes of the recovery point have already been attached. 不能使用原始 VM 的驱动器号装载这些卷。They can't be mounted with the same drive letters of the original VM. 请在文件资源管理器中浏览可用卷。Browse through the available volumes in File Explorer.

“此脚本无效,因为磁盘已通过门户卸除/已超过 12 小时限制。"This script is invalid because the disks have been dismounted via portal/exceeded the 12-hr limit. 请从门户下载新脚本”Download a new script from the portal"

可能的原因:磁盘已从门户卸除或已超过 12 小时的时间限制。Possible cause: The disks have been dismounted from the portal or the 12-hour time limit was exceeded.

建议的操作:下载脚本 12 小时后,脚本将失效,无法运行。Recommended action: 12 hours after you download the script, it becomes invalid and can't be run. 请转到门户,下载新脚本,以继续进行文件恢复。Go to the portal, and then download a new script to continue with file recovery.

无法加载 iscsi_tcp 模块或者找不到 iscsi_tcp_moduleiscsi_tcp module can’t be loaded (or) iscsi_tcp_module not found

建议的操作:若要解决此问题,请按照脚本下载成功但无法运行中的步骤进行操作。Recommended action: To resolve this issue, follow the steps in The script downloads successfully but fails to run.

常见问题Common problems

本部分提供的步骤用于排查在下载和执行用于文件恢复的脚本时可能遇到的常见问题。This section provides steps to troubleshoot common issues you might experience while downloading and executing the script for file recovery.

无法下载脚本You can't download the script

  1. 确保你具有下载脚本所需的权限Ensure you have the required permissions to download the script.

  2. 验证与 Azure 目标 IP 的连接。Verify the connection to the Azure target IPs. 在已提升权限的命令提示符下运行以下命令之一:Run one of the following commands from an elevated command prompt:

    nslookup download.microsoft.com

    or

    ping download.microsoft.com

脚本下载成功,但无法运行The script downloads successfully, but fails to run

在 SUSE Linux Enterprise Server 12 SP4 上运行用于项级恢复 (ILR) 的 Python 脚本时,脚本会失败,并显示错误“无法加载 iscsi_tcp 模块”或“找不到 iscsi_tcp_module”。When you run the Python script for Item Level Recovery (ILR) on SUSE Linux Enterprise Server 12 SP4, it fails with the error "iscsi_tcp module can’t be loaded" or "iscsi_tcp_module not found".

可能的原因:ILR 模块使用 iscsi_tcp 与备份服务建立 TCP 连接。Possible cause: The ILR module uses iscsi_tcp to establish a TCP connection to the backup service. 作为 SLES 12 SP4 版本的一部分,SUSE 从 open-iscsi 包中删除了 iscsi_tcp,因此 ILR 操作会失败。As part of the SLES 12 SP4 release, SUSE removed iscsi_tcp from the open-iscsi package, so the ILR operation fails.

建议的操作:SUSE 12 SP4 VM 不支持文件恢复脚本执行。Recommended action: File recovery script execution isn't supported on SUSE 12 SP4 VMs. 在较旧版本的 SUSE 12 SP4 上尝试还原操作。Try the restore operation on an older version of SUSE 12 SP4.

脚本可以运行,但无法连接到 iSCSI 目标The script runs but the connection to the iSCSI target failed

你可能会看到“连接到目标时捕获到异常”错误消息。You might see an "Exception caught while connecting to target" error message.

  1. 确保运行脚本的计算机满足访问要求Ensure the machine where the script is run meets the access requirements.

  2. 验证与 Azure 目标 IP 的连接。Verify the connection to the Azure target IPs. 在已提升权限的命令提示符下运行以下命令之一:Run one of the following commands from an elevated command prompt:

    nslookup download.microsoft.com

    or

    ping download.microsoft.com

  3. 确保有权访问 iSCSI 出站端口 3260。Ensure access to iSCSI outbound port 3260.

  4. 检查是否有防火墙或 NSG 阻止流量流向 Azure 目标 IP 或恢复服务 URL。Check for a firewall or NSG blocking traffic to Azure target IPs or recovery service URLs.

  5. 确保防病毒软件未阻止脚本的执行。Make sure your antivirus software isn't blocking the execution of the script.

你已连接到恢复点,但磁盘未附加You're connected to the recovery point, but the disks weren't attached

请按照适合你的操作系统的步骤来解决此问题。Resolve this issue by following the steps for your operating system.

Windows 文件恢复在具有存储池的服务器上失败Windows File recovery fails on server with storage pools

在 Windows Server 2012 R2 和 Windows Server 2016(具有存储池)上首次运行脚本时,存储池可能会以只读状态附加到 VM。When you run the script for the first time on Windows Server 2012 R2 and Windows Server 2016 (with storage pools), the storage pool might be attached to the VM in read-only.

若要解决此问题,请手动分配对存储池的读写访问权限并附加虚拟磁盘:To resolve this issue, manually assign read-write access to the storage pool and attach the virtual disks:

  1. 转到“服务器管理器” > “文件和存储服务” > “卷” > “存储池” 。Go to Server Manager > File and Storage Services > Volumes > Storage Pools.

    显示了存储池选项的屏幕截图。

  2. 在“存储池”窗口中,右键单击可用的存储池,然后选择“设置读写访问权限” 。In the Storage Pool window, right-click the available storage pool and select Set Read-Write Access.

    屏幕截图,显示了存储池的右键菜单选项。

  3. 为存储池分配读写访问权限后,在“虚拟磁盘”部分单击右键,然后选择“附加虚拟磁盘”。After the storage pool is assigned read-write access, right-click in the Virtual Disks section, and then select Attach Virtual Disk.

    屏幕截图,显示了虚拟磁盘的右键菜单选项。

Linux 文件恢复无法自动装载,因为磁盘未包含卷Linux File recovery fails to auto-mount because the disk doesn't contain volumes

执行文件恢复时,备份服务会检测卷并自动装载。While performing file recovery, the backup service detects volumes and auto-mounts. 但是,如果备份的磁盘具有原始分区,则这些磁盘不会自动装载,你无法看到要恢复的数据磁盘。However, if the backed-up disks have raw partitions, those disks aren't auto-mounted and you can't see the data disk for recovery.

若要解决此问题,请转到从 Azure 虚拟机备份恢复文件To resolve this issue, go to Recover files from Azure virtual machine backup.

Linux 文件恢复失败,因为 OS 无法识别文件系统。Linux file recovery fails because the OS couldn't identify the file system

运行文件恢复脚本时,无法附加数据磁盘。When you run the file recovery script, the data disk fails to attach. 你看到了“由于 OS 无法识别文件系统,未能装载以下分区”错误。You see a "The following partitions failed to mount since the OS couldn't identify the filesystem" error.

若要解决此问题,请检查是否使用第三方应用程序对该卷进行了加密。To resolve this issue, check if the volume is encrypted with a third-party application. 如果已加密,则磁盘或 VM 不会在门户上显示为已加密。If it's encrypted, the disk or VM won't show up as encrypted on the portal.

  1. 登录到已备份的 VM,并运行以下命令:Sign in to the backed-up VM and run this command:

    lsblk -f

    屏幕截图,显示了用于列出成组设备的命令的结果。

  2. 验证文件系统和加密。Verify the file system and encryption. 如果卷已加密,则不支持文件恢复。If the volume is encrypted, file recovery isn't supported. Azure VM 备份的支持矩阵了解详细信息。Learn more at Support matrix for Azure VM backup.

磁盘已附加,但卷未装载Disks are attached, but the volumes aren't mounted

请按照适合你的操作系统的步骤来解决此问题。Resolve this issue by following the steps for your operating system.

WindowsWindows

运行适用于 Windows 的文件恢复脚本时,你看到“附加了 0 个恢复卷”消息。When you run the file recovery script for Windows, you see a "0 recovery volumes attached" message. 但是,会在磁盘管理控制台中发现这些磁盘。However, the disks are discovered in the disk management console.

可能的原因:通过 iSCSI 附加卷时,检测到的某些卷进入脱机状态。Possible cause: When you attached volumes through iSCSI, some volumes that were detected went offline. 当 iSCSI 通道在 VM 和服务之间通信时,它将检测这些卷并将其联机,但不会装载它们。When the iSCSI channel communicates between the VM and the service, it detects these volumes and brings them online, but they aren't mounted.

屏幕截图,显示了“附加了 0 个恢复卷”消息。

若要识别并解决此问题,请执行以下步骤:To identify and resolve this issue, perform the following steps:

  1. 在“cmd”窗口中,运行 diskmgmt 以打开“磁盘管理”。In the cmd window, run diskmgmt to open Disk Management.

  2. 查找是否有任何附加磁盘。Look for any additional disks. 在下面的示例中,磁盘 2 是一个附加磁盘。In the following example, Disk 2 is an additional disk.

    “磁盘管理”窗口的屏幕截图,显示了附加磁盘。

  3. 右键单击“新建卷”,并选择“更改驱动器号和路径” 。Right-click New Volume, and then select Change Drive Letter and Paths.

    屏幕截图,显示了有关附加磁盘的右键菜单选项。

  4. 在“更改驱动器号或路径”窗口中,选择“分配以下驱动器号”,分配可用的驱动器,然后选择“确定” 。In the Change Drive Letter or Path window, select Assign the following drive letter, assign an available drive, and then select OK.

    “更改驱动器号或路径”窗口的屏幕截图。

  5. 打开文件资源管理器以查看你选择的驱动器并浏览文件。Open File Explorer to view the drive you chose and explore the files.

LinuxLinux

如果受保护的 Linux VM 使用 LVM 或 RAID 阵列,请按照从 Azure 虚拟机备份恢复文件中的步骤操作。If the protected Linux VM uses LVM or RAID Arrays, follow the steps in Recover files from Azure virtual machine backup.

无法从装载的卷复制文件You can't copy the files from mounted volumes

复制可能会失败,并出现错误“0x80070780:系统无法访问该文件。”The copy might fail with the error "0x80070780: The file cannot be accessed by the system."

请检查源服务器是否已启用磁盘重复数据删除功能。Check if the source server has disk deduplication enabled. 如果已启用该功能,请确保还原服务器也在驱动器上启用了重复数据删除功能。If it does, ensure the restore server also has deduplication enabled on the drives. 你可以不配置重复数据删除功能,这样就不会对还原服务器上的驱动器执行重复数据删除操作。You can leave deduplication unconfigured so that you don't deduplicate the drives on the restore server.

后续步骤Next steps