Image Mounter Fails to Remove Drive Letter in Explorer.exe Shell After Dismount


Image Mounter Fails to Remove Drive Letter in Explorer.exe Shell After...
Author
Message
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
When dismounting an image, the drive letter for the mounted image does not automatically go away in File Explorer. This is very likely due to the failure of the relevant user-mode code to (after the dismount is completed by the mount driver) broadcast the windows message WM_DEVICECHANGE with DBT_DEVICEREMOVECOMPLETE, in order to notify the Explorer.exe process (among others) to update its state.

This is in Macrium Reflect Home Edition (subscription) version 8.1.7771 on a fresh Win 11 Pro 23H2 x64 install.
Dan Danz
Dan Danz
Macrium Hero
Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)
Group: Forum Members
Posts: 1.2K, Visits: 9.5K
Otter - 28 November 2023 3:57 PM
When dismounting an image, the drive letter for the mounted image does not automatically go away in File Explorer. This is very likely due to the failure of the relevant user-mode code to (after the dismount is completed by the mount driver) broadcast the windows message WM_DEVICECHANGE with DBT_DEVICEREMOVECOMPLETE, in order to notify the Explorer.exe process (among others) to update its state.

This is in Macrium Reflect Home Edition (subscription) version 8.1.7771 on a fresh Win 11 Pro 23H2 x64 install.
And this is discussed in this KnowledgeBase/UserGuide article.  It's deliberate.

Edited to change the link to a more general article about Browsing with Windows Explorer. 


L.W. (Dan) Danz, Overland Park KS
Reflect v8.1.7847+ on Windows 11 Home 23H2 22631.3085+ | Reflect v8.1.7853+ on Windows 10 Pro 22H2 19045.3996+
Reflect v8.1.7784+ on 2 systems Windows 10 Home 22H2 19045.3803+

Edited 28 November 2023 6:02 PM by Dan Danz
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
Hey Dan, thanks for responding!

I couldn't find anything in the KB/Guide that discusses the drive letter remaining after dismount.  I also searched the KB for all "detach," "dismount,' and "unmount" related articles but couldn't find anything that describes this 'drive letter sticking around' scenario, much less that it's a deliberate thing.  If you're able to find the text that explains why I'd love to see it.  If it is deliberate, I'm quite curious as to why.

Dan Danz
Dan Danz
Macrium Hero
Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)
Group: Forum Members
Posts: 1.2K, Visits: 9.5K
It's deliberate in the sense that when you mount a disk in Windows, it's not dismounted as soon as the user stops consuming the contents.   There are many reasons to NOT unmout a disk just because the user stopped viewing it:
  • For Reflect, it's computer intensive to build and mount a virtual view that might require data from multiple members of the backup set (e.g., a chain of incremental  backups and their parent differential and/or parent full (i.e., it doesn't just grab data from the member you mount), as the user guide puts it:
    If you mount an Incremental or Differential backup, the chosen folder must contain all the files required to load the image you browse. Meaning an Incremental backup requires all the previous files in the backup set to be present, and a Differential backup requires the Full backup to be present.

  • The user might want to compare the contents of two or more backups, perhaps the same data at different points in time.
  • It's why Windows has an EJECT command.  It doesn't automatically eject a removeable device because you closed the Windows Explorer view of its contents.
  • If you plug in a USB disk or a flash drive, usually it is auto-mounted, but you must unmount it when you no longer need to view it.
  • Some disks you mount for writing require you to eject/unmount the disk using a command that ensures the cache is flushed to the disk.
  • Even floppy disks (if you remember such things) had to be unmounted/ejected.
  • Reflect KB and User Guide (in the article linked earlier) say:
    By mounting image files in Windows Explorer you can browse or explore an image and access all the files in a backup. The backed up data appears as a temporary drive in Windows Explorer that you can access, just like any other drive, mounted with its own drive letter.
  • Unmounting is such an entrenched paradigm in computing that I'm astonished that you think programs should grok when all users of, and all programs on, a computer are through with the contents of the device that it's mandatory that the viewing software should automatically UNMOUNT it.  There is one exception, which you will findif you read the KB article:
    If you restart Windows, all temporarily mounted images are detached.
I don't intend this is to be an exhaustive list --- they're just the ones that come to mind at the moment.  



L.W. (Dan) Danz, Overland Park KS
Reflect v8.1.7847+ on Windows 11 Home 23H2 22631.3085+ | Reflect v8.1.7853+ on Windows 10 Pro 22H2 19045.3996+
Reflect v8.1.7784+ on 2 systems Windows 10 Home 22H2 19045.3803+

Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
Thanks for providing the additional details!

But no.  This is a bug.

When I mounted the volume, I mounted it to E:.  E: was visible as a symbolic link in the GLOBAL?? namespace in WinObj.exe (from Sysinternals).  Then after dismounting E: the symbolic link E: is no longer present in the GLOBAL?? kernel namespace, however E: still showed up in File Explorer. This means that any access to that E: drive from File Explorer would not work because there is no actual kernel symbolic link to the device object (in this case it linked to \Device\PSMounterEx0) existed anymore. 

I have also seen that when I try to reproduce it apparently this bug only occurs occasionally because now the drive letter disappears in File Explorer.

This is actually an issue with Explorer handling the device change windows message (or not handling it as the case may be), and this means that the Reflect developer(s) who is issuing that WM_DEVICECHANGE windows message needs to play around with it and perhaps broadcast the message more than once.  Explorer can be flaky handling these messages (speaking from rather extensive experience).

Incidentally, poking around at this thing to observe how it works revealed that the mount driver appears to be reserving ten device objects (PSMounterEx0 through PSMounterEx9) which exist before any mounts have occurred and are re-used.  This makes me assume that one can only mount up to 10 images concurrently.  Is that correct.  It's an interesting design choice and honestly I don't see an issue with it.  There's also a PSMounterExCd0 device object presumably for mounting .ISO files.
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
Also, to clarify, the text you pasted had this statement:

"Unmounting is such an entrenched paradigm in computing that I'm astonished that you think programs should grok when all users of, and all programs on, a computer are through with the contents of the device that it's mandatory that the viewing software should automatically UNMOUNT it. There is one exception, which you will findif you read the KB article."

I want to make it very clear that I am not talking about Macrium Reflect guessing when I'm done with the volume, such as when File Explorer is closed, and dismounting the volume.  I'm talking about when I explicitly told Macrium Reflect to dismount the mounted image, and it performed the dismount successfully, however File Explorer doesn't always refresh its state to show that the drive letter is no longer available.  This is due to File Explorer being flaky in handling of WM_DEVICECHANGE messages and that's what I'm pointing out can be improved.
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
> you apparently think that Reflect just assembles the data and lets you view it. Instead, it creates the virtual image in a file, and then makes that file available for viewing outside of Reflect.

I understand very well how a backup image mount driver and its associated tooling works.  I wrote such drivers for two shipping products, so I'm quite familiar with the topic.

> When did you "dismount" it? That's just it, you didn't! Just because you closed Reflect, the file isn't deleted and the letter is still attached. And if it was auto-unmounted, you'd rightfully be annoyed.

I performed the dismount by right-clicking on the mounted drive letter in File Explorer, selecting "Show More Options" from the context menu, then selecting Macrium Reflect and then Unmount Macrium Image.  The mounted image's symbolic link indeed disappears in the GLOBAL?? kernel namespace so the device driver had deleted it, and usually the drive letter also disappears in File Explorer.  What I'm trying to point out is that the drive letter doesn't always disappear in File Explorer after an explicit successful dismount has occurred.  And I thought I was being helpful by pointing out why.  Also, related to this is a second bug which is that during MOUNT of an image, if you have multiple Explorer processes (where each explorer window has its own process) then they don't always show the new drive letter after the MOUNT has succeeded.  Again, this is issues with WM_DEVICECHANGE.  It's not terribly hard to fix this stuff.  I just though I'd point it out.
Edited 28 November 2023 9:39 PM by Otter
Dan Danz
Dan Danz
Macrium Hero
Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)Macrium Hero (2.7K reputation)
Group: Forum Members
Posts: 1.2K, Visits: 9.5K
I understand now, but must point out that this is a USER forum. Perhaps the support employees who monitor this forum might see your post and pass it on to development, or maybe Windows developers will fix their Explorer.  But none of us are going to change anything.

As for using the adjunct shell commands for Reflect in Windows File Explorer to detach the image, you might get a different result if you used Reflect's menus for the whole thing.  Main menu Restore:



L.W. (Dan) Danz, Overland Park KS
Reflect v8.1.7847+ on Windows 11 Home 23H2 22631.3085+ | Reflect v8.1.7853+ on Windows 10 Pro 22H2 19045.3996+
Reflect v8.1.7784+ on 2 systems Windows 10 Home 22H2 19045.3803+

Edited 28 November 2023 9:47 PM by Dan Danz
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
I tried to report this through Macrium's bug reporting feature but it requires a ticket number and I don't have one.  I also noticed that Macrium employees seem to be active in these forums so I figured I could just toss this info in here and they'd likely proactively take care of it.  I mean that's how I worked back in the day with various imaging products I made.  I love it, in fact, when users would just hand me the info I needed to make my products better.

Also just consider me another user, like you.  I bought Reflect and am using it to backup my new Windows dev box (having recently returned to Windows after years in Linux) and I'm really enjoying using this product.  I'd probably have used the stuff I made myself but it's been years since I was involved in those code bases and I have no idea how the quality has gone since I departed, what with multiple acquisitions and such.  But I do know Macrium has a good rep and I believe it is actively maintained (heck, I just got an update today!) so that's really why I'm using it.
Otter
Otter
New Member
New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)New Member (46 reputation)
Group: Forum Members
Posts: 31, Visits: 48
> maybe Windows developers will fix their Explorer

Given that this particular issue has been unaddressed by Microsoft since Windows XP, I'm not optimistic about a near-term resolution on their end.  Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search