Virtual PC 丢失了差异 VHD 的父磁盘

Virtual PC 丢失了差异 VHD 的父磁盘

两年前我有过杰出的一个想法是创建基础 Windows XP 磁盘,我所有装有 XP 的 VM 都将使用它。
当然,最后我只有一个装有 XP 的 VM :-)。

今天我需要在我的硬盘上腾出一些可用空间,所以我找到了一个名为“Windows XP”的未使用的 VM,它只有 5GB。我尽快删除了它 :-),当然我使用了 shift 来不使用“回收站”。

现在,当我想运行我的 XP VM 时,我收到以下错误:“... 的一个父硬盘丢失了。”

只要我可以从我现在拥有的这个差异 vhd 中恢复文件,这对我来说就不是问题了。

所以:

  • 我有包含我需要的文件的差异磁盘
  • 我没有父磁盘

我的问题是:如何从这个差异 hvd 恢复文件?

答案1

如果只有 5Gb,你可能需要尝试使用恢复软件,例如 Diskeeper 恢复删除

更新:我使用的并且发现非常有用的软件是删除删除工具它将告诉您文件是否可以恢复。这可能是前进道路上阻力最小的路径。我将很快发布有关从差异磁盘恢复的更多信息。

更新 (2):Ben Armstrong(微软虚拟化项目经理)博客

“如果没有父 AVHD,就无法从子 AVHD 获取数据。”

需要尽可能获取父 VHD。对磁盘密集型操作要非常小心,因为这些操作可能会覆盖或损坏已删除的文件。我内心的程序员说你“可能”能够将子 VHD 解析为字节流并查找特定文件的标记并以某种方式恢复文件,但这不太可能。

答案2

我怀疑你必须找出很多关于 vhd 文件内部工作原理的信息,或者以某种方式挂载它,也许虚拟硬盘挂载或者響鳴或者类似的东西会起作用...我不知道是否需要原始磁盘,因为我不知道差异磁盘中存储的内容的详细信息。

我假设雷库瓦查找并恢复原始文件是不可能的,因为如果您的空间不足,您会用其他数据填充它,因此原始文件会丢失。

答案3

我找到了一个名为用于虚拟驱动器的 MediaHeal用它扫描我的不同 vhd 后,似乎我可以恢复我的文件。演示版本仅恢复文件夹/文件结构,但它证明它可以以某种方式将这些差异解码为 NTFS。

在此处输入图片描述

现在我知道这是可能的,所以我很放心。这个工具售价 199 美元。如果有人知道更便宜/免费的东西,我很乐意听取建议!

答案4

此引用也可能帮助你:

    Implementing a Differencing Hard Disk 
    
    A differencing hard disk stores the file locator of the parent hard disk inside the differencing hard disk itself. When a virtual machine tries to open a differencing hard disk, both the differencing hard disk and the parent hard disk are opened. The parent hard disk can also be a differencing hard disk, in which case there could be a chain of differencing hard disks which finally end in a non-differencing hard disk. 
    To have the ability to move hard disks across platforms, the hard disk format is designed in such a way that it can store parent hard disk file locators for different platforms at the same time.
    The parent locator table is used only by the differencing hard disks, as described in “Dynamic Disk Header Format” earlier in this paper. The parent locator table stores a platform code for every parent file locator stored in the file. The virtual machine reads the appropriate parent file locator for the current platform and opens the hard disk image. 
    In Windows, there are two types of platform locators: W2ku and W2ru. The former is the absolute pathname of the parent hard disk, and the latter is a pathname to the parent hard disk relative to the differencing hard disk. 
    For example, a parent hard disk image located in the root drive on a typical Windows-based machine would be stored as follows:

    Type    Example
    W2ku    c:\directory\parent.vhd
    W2ru    .\directory\parent.vhd
    
    As an example on a typical Apple Macintosh-based machine, the parent hard disk image would be stored as follows:

    Type    Example
    Mac (Mac OS alias stored as a blob)
    MacX    file://localhost/directory/parent.vhd
    
    The advantage of the relative pathname is that it allows portability of the differencing and parent hard disk to different locations. With the absolute pathname, whenever the parent hard disk is moved, the parent and child hard disks must be explicitly re-linked. 
    
    When a differencing disk is being created, pathnames for both types of platform locators on the respective platforms should be initialized if possible.
    Note: Versions previous to Microsoft Virtual PC 2004 only stored the absolute pathnames.

    Write Operation for a Differencing Hard Disk
    For a write operation, all data is written to the differencing hard disk image. The block bitmap is marked dirty for all the sectors written to the particular block.

    Read Operation for a Differencing Hard Disk
    When a virtual machine reads sectors of a hard disk image, the differencing hard disk subsystem checks the block bitmap in the differencing hard disk. The differencing hard disk subsystem reads the sectors marked dirty from the differencing hard disk and the sectors marked clean from the parent hard disk.
    For example, consider a block that holds sectors 4096 through 8191 in both the parent and child hard disk image. The first sector of the block holds the bitmap for the block. A single cell represents a bit in the bitmap and a black dot represents the particular sector in the block has been written to by the virtual machine.

相关内容