Auto Dismount

USBDLM

 

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.

 

Problem:

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:

 

[AutoDismount]

DriveType=REMOVABLE

Interval=10s

 

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

[AutoDismount]

DeviceID=USB\VID_13FE&PID_1F00

Interval=0

 

; for all other USB removable drives we want

[AutoDismount]

DriveType=REMOVABLE

Interval=10s

 

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:

 

[Settings]

AutoDismountGracePeriod=30s

 

 

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

 

[Settings]

AutoDismountIcon=2

 

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:

 

[Settings]

AutoDismountIconBackgroundColor=0x80FF80

 

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).