Auto Dismount





Since V5.0 USBDLM can periodically try to dismount volumes (detaching the file system). This succeeds only if there is no open file on the volume. On next access Windows auto-mounts the file system again. This takes a moment, also because the file cache is discarded on dismount.


Knowing a volume being dismounted one could remove USB flash drives safely without ejecting or safely removing it.


Warning: Don't assume the removal of an SSD would be safe when the file system is dismounted! You never know if a SSD is perfoming optimation jobs internally. Therefore using "safe removal" is the only right choice here in hope that a shutdown signal makes it to the SSD.


USBDLM's auto-dismount works with local volumes only and for instance not with TrueCrypt volumes because they do not support the required notifications.



The Windows Explorer's "Safely remove hardware" tray icon seems to freeze when the last drive in its menu is ejected by means of the Windows Explorer's drive context menu item "Eject" if the drive was already dismounted - by USBDLM or someone else.



To configure drives for auto-dismount create a section [AutoDismount] with criteria as for a DriveLetters section.

Since auto-dismount usually works with "removable" drives only (on fixed drives the Windows SearchIndexer makes it mounted again quite fast), DriveType=REMOVABLE would be the right critera:






Since Windows Vista on FIXED drives the Windows SearchIndexer is periodically accessing all volumes and causes them being mounted again. I've found no way to stop this other than disabling the "Windows Search" service (WSearch).


UsbDriveInfo shows the mount status.


An Interval of 0 disables the auto-dismount. This way you can exclude a drive:


; no auto-dismount for this drive





; for all other USB removable drives we want





After arrival for some time no auto-dismount is performed, since usually the user wants to access the just arrived drive. This "grace period" is by default 30 seconds and can be configured globally:






Since V5.1 USBDLM can show tray icon with up to four drive letters of dismounted volumes:





0: Off

1: Show if there is at least one dismounted drive

2: Show always


Default is 2 if there is at least one [AutoDismount] section, 0 otherwise.


The background color of the tray icon can be configured with a Blue/Green/Red hex value like so:





For now only drive letters can be shown in the tray icon and only up to four in alphabetic order.


On a mouse-move over the tray icon all volumes configured for auto-dismount are tried to dismount immediately, therefore an always visible tray-icon is useful.

If you want no auto-dismount but manual only then just configure -1 as interval, this resolves to and interval of 232 milliseconds (49.7 days).