none
disk2vhd and mounting in read-only mode

    Întrebare

  • I've just created a vhd image of my system disk:

    1. disk is 500GB SSD
    2. MBR
    3. there are 3 partitions: BDEDrive (\\?\Volume{...}), OS (C:), data (D:).
    4. I've disabled bitlocker before starting and waited for it to fully decrypt the disk.
    5. Windows 7 x64
    6. I'm using Disk2vhd 2.01 from here
    7. I've tried selecting either all 3 partitions, "just C:", and "just D:"
    8. "Use volume shadow copy" checkbox was checked in all cases
    9. I've tried both checking and unchecking "use vhdx" checkbox

    In either case, I get one output file. Next, I try to mount it on the same system via "disk management -> Action -> Attach VHD". In the dialog window it shows - I set the read-only checkbox. And.... It shows me a new drive with a single "RAW" partition. The size of the drive is equal tho the size of my physical disk.  But why?

    It took a while before I've decided to try to attach it without setting the read-only checkbox, it correctly loads the list of partitions, but complains that there's a name collision. So, the disk is offline first. However, simply selecting "online" in context menu magically makes it work (this page says it assigns a new disk signature). Next, I'm able to detach it, and attach as read-only and - it works.

    So...

    1. Am I doing something wrong?
    2. Why does it show incorrect partitions list at first if I try to mount it as read-only? (OK, it's unable to mount it... But why show incorrect partitions list?) Is it a bug? 
    3. Is it related to signature collision again, or is it something different?
    4. May be it is worth to document this behavior somewhere in the docs?
    vineri, 17 noiembrie 2017 17:43

Răspunsuri

  • Thanks for your information, your feedback is of great importance to us in order to improve our performance.

    Also I will forward this information to the appropriate department through our internal channel. Both the Microsoft Product Team and Development Team take into consideration all suggestions and feedback for future releases.

    Thanks again.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marcat ca răspuns de i3v luni, 22 ianuarie 2018 13:50
    luni, 22 ianuarie 2018 01:44

Toate mesajele

  • Hi,

    I have tested on my Windows 7 and please note that you should uncheck the option"Use vhdx" when you use Disk2vhd.

    I mount the vhd and choose read-only, it works and the disk is online status.Since I have no write permission, I can't change it to offline status. It is suggested that you can run chkdsk in cmd as administrator to have a scan over your SSD. From my test, the system funtion is good.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    luni, 20 noiembrie 2017 09:32
  • Hi vivian,

    Please excuse me for a late response.

    1. I do use "vhd", not "vhdx"
    2. I think your experiment is a bit different. This issue is definitely not occurring in all cases. It probably depends on some factor or some combination of factors.
      • It was OS disk in my case
      • There’s a bitlocker partition in my case
      • Maybe there should be exactly 3 partitions, or something… Who knows…
    3. I’ve just reproduced this issue on another PC, with a similar OS.

    The "Disk 3" only contains "Unallocated", while it's actually the same vhd (a copy) as "Disk 2". The only difference between them is that "Disk 3" is read-only, while "Disk 2" is not. 

    After I put "Disk 2" online, I can see my files on "G:" (vhd doesn't contain an image of "F:", so "E:" is RAW).

    Yet another funny thing: this time I've created the vhd without turning off bitlocker on "C:" in advance. Surprisingly, it's still works (even though this page says I should turn it off first). And "G" is not encrypted. How convenient :)

    PS

    I'm not sure, what are you trying to show on your screenshot.

    AFAIU, your "Disk 2" is an image of "Disk 1". You've said I mount the vhd and choose read-only, it works and the disk is online status, But it's in "Unknown" state, and it's content is not properly shown - it shows "Unallocated", which is misleading. Probably this is exactly the issue I'm talking about - I'd say it should show a correct partition table (or nothing, if some error occurs before partition table could be read). Showing "Unallocated" is just wrong.


    • Editat de i3v joi, 4 ianuarie 2018 04:40 Added "PS"
    joi, 4 ianuarie 2018 04:18
  • Hi,

    From my test, when you attach a vhd file (read-only or uncheck read-only), it is offline/unknown status by default, which you can't access them in Explorer. This is because it hasn't been initialized and there is not any drive information in Disk Management. In fact, no matter Offline or Unknown status, they are almost the same statue. The only difference is you have no write permission when you check the Read-only status. When in an unknown statue, you can't change it to an offline statue, a error pop up as below, which proved that you have no write permission.

    The point is when you change it to an online statue from offline, you can access the drive in Explorer. Then detach it, after that re-attach it again(read-only or uncheck read-only), you will find that you can access the drive now. The reason is that when bring it to an online statue, system will view it as a installed device, initialize the drive, install the driver, file system and so on. We can find the GUID in setupapi.log, mine is {731fc713-df19-11e7-8f63-001dd8b7fee9}#0000001483100000.

    Next time you attach a vhd, system will search the GUID from the cache, so that we can access the drive. To prove the point, I capture the process and found that system will open the registry and locate at the device GUID.

    So the behavior has a proper explanation, right?


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    vineri, 5 ianuarie 2018 12:21
  • Thanks for additional details!

    I do understand that there's a signature collision, and that it is hardly possible to fix that collision without changing the vhd file (which is prohibited by its read-only status) so it won't work.

    But... Why is it showing "Unallocated"? Let's take a look at the following two disks:

    at the first glance, they look somewhat similar, right?

    I've manually removed all partitions on "Disk 2" to make its partition table look like this. The "Disk 3" got a signature collision and is attached in read-only mode (it do have partitions and data on it).

    Let's imagine I have some valuable data on "Disk 3". It looks a bit scary, right?

    For "Disk 2" this large black scary "Unallocated" bar actually means that all data there is destroyed. And "Disk 3" looks very similar to this. It looks like all data is destroyed. Which is counter-intuitive, and misleading. So, my first guess was "is this file damaged, incompatible or something?".

    Moreover, AFAIU, showing "Unallocated" for "Disk 3" is also incorrect from a formal point of view. AFAIU, it's showing "Unallocated" because it's unable to read the actual partition table. It's reporting "There's nothing", while it should actually report "I don't know what's there".  

    Moreover, if I do not set the read-only flag,

    1. there's a nice "i" icon:
    2. I can see my partitions, even though there's still a collision
    3. There's also a nice and understandable tooltip:
      (I wish it would also say "Click "Online" to automatically modify the signature and fix the collision" though.)

    Sadly, there's nothing like this if I attach my vhd in read-only mode... It would be much easier to understand what's going on, if it would be there.

    vineri, 5 ianuarie 2018 15:32
  • OK, so, I think the answer is:

    1. Showing "Unallocated" there is a bug.
    2. This bug is already fixed in Windows 10.

    Just for reference, this is how it looks in Windows 10:

    1. Signature collision does not mean that "Unallocated" is shown instead of correct partition tableSignature collision does not mean that
    2. Here's what "i" tells you:
      tooltip
    3. Here's what you get when you try to switch it to online:
      (It would be nice if the error message would be a bit more user-friendly, but that's not a real problem)
      3. trying to switch it to online

    sâmbătă, 20 ianuarie 2018 14:37
  • Thanks for your information, your feedback is of great importance to us in order to improve our performance.

    Also I will forward this information to the appropriate department through our internal channel. Both the Microsoft Product Team and Development Team take into consideration all suggestions and feedback for future releases.

    Thanks again.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marcat ca răspuns de i3v luni, 22 ianuarie 2018 13:50
    luni, 22 ianuarie 2018 01:44