Unidesk - Recovering Files from Corrupted Desktop
Recovering files directly from the User Layer disks when a desktop machine cannot boot
Troubleshooting Articles
- KB #: 13863
- Last Updated: February 13, 2014
When a desktop will not boot up or the Unidesk tasks for it consistently
fail, it is possible to recover the user's data by copying it directly from the
User Layer VMDK or VHDX files. You might want to do this if you think the
desktop is unrecoverable, but also if you think the user will need their data
before you or Unidesk Support will be able to get it working again. Or, if you
need to Repair the desktop to an older backup, you can recover files from the
current state before overwriting the disks.
This technique can also be used to repair corrupted personalizations, for instance by running CHKDSK on them, which can sometimes resurrect a machine that fails all of its Unidesk tasks. For this situation, specifically look for a desktop task that fails with the error "Encountered an error while attempting to mount a disk". That means that we failed to mount the NTFS filesystem of a disk we successfully attached to the CachePoint.
Before you start
This procedure applies to both Unidesk 2.x for vSphere and Unidesk 3.X for Hyper-V. In VMware, you will need a non-Unidesk Windows VM on which to mount the disks. This non-Unidesk machine must be on an ESX host which has access to the Layer storage tier for the CachePoint where the desktop is. You will need vSphere permissions to Edit Settings on this non-Unidesk VM to attach the User Layer disks. You also need to be able to shut this VM down.
In Hyper-V, you will be able to mount the User Layer VHDX file as a disk directly on a Hyper-V server.
All Unidesk layers are normal virtual disks (VMDK or VHDX files) with standard NTFS filesystems on them. That means that any Windows VM can have that virtual disk attached to it, and the disk will be detected as a normal Windows lettered drive. You can browse through the disks and copy any data you need from the User Layer onto your local machine or a file server. However, a Unidesk VM will recognize the disks as being Unidesk layers, and will hide them from the user as it does any other attached layer disks. So you need to do this with a non-Unidesk Windows machine. You may find your original Gold VM is convenient to use in VMware, and the Hyper-V host is sufficient to mount up virtual disks.
Recovering data from a desktop's personalization layer
If the desktop VM is running, shut it down or, if necessary, power it off.
If the desktop VM has a vSphere snapshot on it, remove it. Unidesk will keep a snapshot on its desktops for backup purposes, but it needs to be removed for data recovery.
The User Layer (sometimes called the "personalization" or "UEP" for User Experience Package) is made up of two VMDKs in vSphere (see this article for why), and is only one disk in Hyper-V. These are located under the directory of the CachePoint that the desktop is assigned to, in the "UnideskLayers/User" folder, under the name of the desktop. The CachePoint's VM directory can be found in the "CachePoint and Layers" storage tier, or by looking at the configuration of the CachePoint virtual machine. The User Layer directory would be located somewhere like this:
[CPLayersDatastore] CachePointName/UnideskLayers/User/DesktopName
or
E:\Hyper-V\Virtual Machines\UnideskLayersTier\CachePointName\UnideskLayers\User\DesktopName
In VMware, you will find two disks named like this (in Hyper-V, you will only see the V0 disk):
Pxyz.B0.R1.V0.vmdk
Pxyz.B0.R1.V1.vmdk
"xyz" here is the internal Unidesk desktop ID number. However, there will only be one set of disks in that directory. In VMware, the "V1" VMDK is the data volume, and will have most of what you want on it. What goes into the configuration volume on V0 is based purely on a list of file extensions that are separated out to allow granular repairs (see the above link). You should always check both. In Hyper-V, both configuration and user data sre stored on the single User Layer disk.
Access the User Layer disks in VMware:
Make a note of which datastore you need to get the User Layer disks from.
Mount the disks on a non-Unidesk VM.
When you've gotten the files you want and it's time to clean up, in VMware you must shut down the non-Unidesk Windows machine. Once it's down, Edit Settings on the non-Unidesk VM again, find the disks you mounted, and remove them. Make sure to select the default — "Remove from virtual machine" — and not the one that deletes the disk. In Hyper-V, right-click on the drive in Explorer and select Eject.
That's it. You're done.
This isn't a substitute for getting the desktop back, but it can save you pain and buy you time. And it allows you to recover files from an otherwise completely unrecoverable VM.
This technique can also be used to repair corrupted personalizations, for instance by running CHKDSK on them, which can sometimes resurrect a machine that fails all of its Unidesk tasks. For this situation, specifically look for a desktop task that fails with the error "Encountered an error while attempting to mount a disk". That means that we failed to mount the NTFS filesystem of a disk we successfully attached to the CachePoint.
Before you start
This procedure applies to both Unidesk 2.x for vSphere and Unidesk 3.X for Hyper-V. In VMware, you will need a non-Unidesk Windows VM on which to mount the disks. This non-Unidesk machine must be on an ESX host which has access to the Layer storage tier for the CachePoint where the desktop is. You will need vSphere permissions to Edit Settings on this non-Unidesk VM to attach the User Layer disks. You also need to be able to shut this VM down.
In Hyper-V, you will be able to mount the User Layer VHDX file as a disk directly on a Hyper-V server.
All Unidesk layers are normal virtual disks (VMDK or VHDX files) with standard NTFS filesystems on them. That means that any Windows VM can have that virtual disk attached to it, and the disk will be detected as a normal Windows lettered drive. You can browse through the disks and copy any data you need from the User Layer onto your local machine or a file server. However, a Unidesk VM will recognize the disks as being Unidesk layers, and will hide them from the user as it does any other attached layer disks. So you need to do this with a non-Unidesk Windows machine. You may find your original Gold VM is convenient to use in VMware, and the Hyper-V host is sufficient to mount up virtual disks.
Recovering data from a desktop's personalization layer
If the desktop VM is running, shut it down or, if necessary, power it off.
If the desktop VM has a vSphere snapshot on it, remove it. Unidesk will keep a snapshot on its desktops for backup purposes, but it needs to be removed for data recovery.
The User Layer (sometimes called the "personalization" or "UEP" for User Experience Package) is made up of two VMDKs in vSphere (see this article for why), and is only one disk in Hyper-V. These are located under the directory of the CachePoint that the desktop is assigned to, in the "UnideskLayers/User" folder, under the name of the desktop. The CachePoint's VM directory can be found in the "CachePoint and Layers" storage tier, or by looking at the configuration of the CachePoint virtual machine. The User Layer directory would be located somewhere like this:
[CPLayersDatastore] CachePointName/UnideskLayers/User/DesktopName
or
E:\Hyper-V\Virtual Machines\UnideskLayersTier\CachePointName\UnideskLayers\User\DesktopName
In VMware, you will find two disks named like this (in Hyper-V, you will only see the V0 disk):
Pxyz.B0.R1.V0.vmdk
Pxyz.B0.R1.V1.vmdk
"xyz" here is the internal Unidesk desktop ID number. However, there will only be one set of disks in that directory. In VMware, the "V1" VMDK is the data volume, and will have most of what you want on it. What goes into the configuration volume on V0 is based purely on a list of file extensions that are separated out to allow granular repairs (see the above link). You should always check both. In Hyper-V, both configuration and user data sre stored on the single User Layer disk.
Access the User Layer disks in VMware:
Make a note of which datastore you need to get the User Layer disks from.
Mount the disks on a non-Unidesk VM.
- Power up your non-Unidesk VM, and login as an administrator so you will have full access to the data.
- In vSphere for your non-Unidesk VM, Edit Settings. On the Hardware tab, click Add, Hard Disk, Next, "Use an existing Virtual disk", Next, and then browse to the personalization layer VMDKs. (Note: You can only add one hard disk at a time in VMware, so pick one now and then repeat everything if you need both.)
- On the next screen, it depends on what you're doing. If you are only recovering files, select Independent and Nonpersistent, so that nothing you do in this process will affect, and potentially damage, it. If you are attempting to repair the User Layer disks, unselect Independent, leaving the disk Dependent and Persistent so that you can actually repair the disk.
- Finish, click OK. Wait a moment for VMware to do a reconfigure operation.
- Login to a Hyper-V host that has access to the disk.
- Click down in Explorer to find the User Layer VHDX
- Double-click on it. It will be mounted directly on your Hyper-V host as the next available lettered disk in Explorer.
When you've gotten the files you want and it's time to clean up, in VMware you must shut down the non-Unidesk Windows machine. Once it's down, Edit Settings on the non-Unidesk VM again, find the disks you mounted, and remove them. Make sure to select the default — "Remove from virtual machine" — and not the one that deletes the disk. In Hyper-V, right-click on the drive in Explorer and select Eject.
That's it. You're done.
This isn't a substitute for getting the desktop back, but it can save you pain and buy you time. And it allows you to recover files from an otherwise completely unrecoverable VM.
Comments
Post a Comment