Mounting volume containing NTFS filesystem from Windows 2012 virtual machines as read-only using VixMntAPI on earlier version of VDDK proxies fails with the error: Failed to read First Object. Volume/NTFS filesystem is corrupt (87)
search cancel

Mounting volume containing NTFS filesystem from Windows 2012 virtual machines as read-only using VixMntAPI on earlier version of VDDK proxies fails with the error: Failed to read First Object. Volume/NTFS filesystem is corrupt (87)

book

Article ID: 309693

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction


Symptoms:
  • Cannot mount volume containing NTFS filesystem from Windows 2012 virtual machines as read-only using VixMntAPI on earlier version of VMware Virtual Disk Development (VDDK) proxies
  • Mounting volume containing NTFS filesystem from Windows 2012 virtual machines as read-only using VixMntAPI on earlier version of VDDK proxies fails
  • In the VDDK log file, you see an error similar to:

    Failed to read First Object. Volume/NTFS filesystem is corrupt (87)

    Note: For location of VDDK log files, see Collecting diagnostic information for the VMware Virtual Disk Development Kit (1006186).

  • When accessing the mounted volume, you see this error in the pop-up:

    The media is write protected


Environment

VMware Virtual Disk Development 1.2
Virtual Disk Development Kit 5.5

Cause

This issue occurs when a virtual machine containing Windows 2012 NTFS filesystem is mounted on Windows 2008 R2 as the earlier version has a problem interpreting the later version data.
Windows 2008 R2 attempts to run some repairs when the Windows 2012 disks are mounted. Since the volume is mounted as read-only, the repair fails causing the volume to become inaccessible.

Resolution

To work around this issue, use one of these workaround steps:

  • Mount these virtual disks read/write so that the system has a chance to repair them.
  • Create a writable redo log locally on the proxy. The redo log has the read-only base disk as a parent (the disk that was just backed up). This allows the Operating System (OS) to repair the disk to avoid any errors. This redo log is then mounted with VixMntapi and files are accessed. After that, the redo log is unlinked from the parent and discarded, leaving the parent disk unchanged.

    Note: These extra steps add no measurable overhead and therefore, it does not affect the overall backup time.
To create a writable redo log locally on the proxy:

Note: Take a backup of the disk, excluding mounting the disk with VixMntapi.
  1. Run this command to create a local connection:

    VixDiskLib_Connect(NULL, &localConnection)

  2. With the backed up disk still open (called as parent disk), run this command:

    VixDiskLib_CreateChild(parentHandle, "C:\temp.vmdk", VIXDISKLIB_DISK_MONOLITHIC_SPARSE, NULL, NULL)

    Note: The preceding command fails if the file already exists. The file can be created in any existing folder and can have any name.

  3. Run this command to open the temp redo log:

    VixDiskLib_Open(localConnection, "C:\temp.vmdk", VIXDISKLIB_FLAG_OPEN_SINGLE_LINK, &redoHandle)

  4. Run this command to attach the redo log to the parent disk:

    VixDiskLib_Attach(parentHandle, redoHandle)

  5. Run this command to open the disk set, get volume handles and mount the volumes etc:

    VixMntApi_OpenDiskSet(redoHandle (put this in an array), 1, 0, &diskSetHandle)
    ...
    ...
    DefineDosDevice(...)
After creating a writable redo log locally on the proxy, perform these steps to clean up:
  1. Run this command to remove the definition for each volume:

    DefineDosDevice(...DDD_REMOVE_DEFINITION...)

  2. Run this command to unmount each volume:

    VixMntapi_DismountVolume(handle[i], false)

  3. Run this command to close the disk set:

    VixMntapi_CloseDiskSet(diskSetHandle)

  4. Run this command to close the redo log.

    VixDiskLib_Close(redoHandle)

    Note: This automatically closes the parent disks.

  5. Run this command to unlink the redo log from the parent disk:

    VixDiskLib_Unlink(localConnection, "C:\temp.vmdk")

  6. Run this command to delete the redo log:

    DeleteFile("C:\temp.vmdk");

  7. Run this command to disconnect from the local connection:

    VixDiskLib_Disconnect(localConnection)

Note: After completing the preceding cleanup procedure, perform the usual cleanup steps (such as disconnect from virtual machines etc).


Additional Information

Collecting diagnostic information for the VMware Virtual Disk Development Kit