8

I have a Windows 2003 server machine, this machine is backed up by a nightly scheduled task that copies files and folders to a portable USB hard drive (encrypted using TrueCrypt)

Every week the portable drive is takes off-site and another drive is connected (we currently rotate between 2 portable drives).

The problem is that every week when we rotate the drives we can't dismount the connected drive because of some random file or folder that is open, the process holding the file open is always explorer.exe.

If I close the handle by using ProcessExplorer everything works - the volume is dismounted cleanly and explorer continues to work normally.

I want to know how to stop explorer from keeping the file open in the first place, I suspect some 3rd party code that is loaded into explorer is the problem but I don't know how to track it down.

This is a production server, so installing debugging tools or doing anything that will take the server off-line for more than a few minutes is not acceptable.

Thanks

EDIT: Thank you for suggesting unlocker but I want to prevent getting into the locked file situation in the first place, this is a production server and I don't want mess up the explorer process.

Another Edit Is you want to know why I don't want unloacking tools just read this http://technet.microsoft.com/en-us/magazine/2009.04.windowsconfidential.aspx

Nir
  • 121
  • 6
  • 12

5 Answers5

5

Change explorer.exe's focus onto a folder of another partition.

5

Use unlocker. First unlock your root drive using Sent to --> unlock then you will be able to remove it easily. It won't make your server unavailable and it is a very small utility. I am working with it on Win 2003 perfectly.

0

Sometimes the Windows Indexing Service starts working on the file system and in the process locks the files.

This RemoveDrive tool supports stopping the service for a short while to remove the USB drive. This has worked quite well for me.

RemoveDrive DriveSpec: [-l][-h][-b][-i][-s][-w:nnnn]

DriveSpec: is the drive to remove, e.g. U: or \ for the current drive
[-L] loop until success
[-h] show open handles (admin rights required, exprimental, may freeze!)
[-w:nnnn]  wait nnnn milliseconds before close
[-s] self delete removedrive.exe
[-b] let Windows show the "Safe To Remove Hardware" balloon tip
[-i] stop Windows indexing service (CiSvc) for a moment 
     if required (admins)
[-d] show debug information

Generic notes.

  • The drivetools page is in general a very good reference for USB related points
  • Microsoft Indexing Service is notorious for processor hogging and in some cases also pagefile fragmentation. You might want to read up some more and consider selectively stopping it recursively over specific folders (right click, properties, General, Advanced).
  • Sysinternals PageDefrag is a good tool to check page file fragmentation and defragment the same (requires a reboot)
nik
  • 7,040
  • 2
  • 24
  • 30
0

If you suspect an explorer addon, try shexview, which can list and disable them for you. You will have to kill & restart all explorer.exe processes for it to take effect, though.

On the other hand, on a server you might just disable all of them, since who needs PDF preview in Explorer and similar things on a server?

mihi
  • 820
  • 1
  • 7
  • 13
0

Are you dismounting Truecrypt first? More than likely it's itself Truecrypt that is preventing the dismount. It will appear to be Explorer because of the way the Truecrypt service works.

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
  • I get the error when I'm dismounting TrueCrypt, not when I'm disconnecting the physical drive – Nir Jul 08 '09 at 07:29