Link to home
Avatar of dt3itsteam
dt3itsteam

asked on

Automate USB Drive Removal with devcon.exe and batch file.

Hi Experts,

Objective:

To be able to remove a USB HDD using a batch file and devcon.exe utility.

Scenario:

Running Symantec Backup Exec 12, backing up to a rotation of USB HDD's on a SBS 2003 Server.

Problem:

SBS Reporting is coming out with the following critical error:

************************************************************
 Low Disk Space (HarddiskVolume6)
23/07/2008 13:18      1
The following disk is low on free disk space. Low levels of free disk space can cause performance problems and prevent users from saving files on the disk.

Drive Letter: HarddiskVolume6
Free Disk Space: 0.000000. MB
% Free Disk Space: 0.000000.%

You can disable this alert or change its threshold by using the Change Alert Notifications task in the Server Management Monitoring and Reporting taskpad.
****************************************************************

Now after some initial research, it seems to be a bug in SBS 2003 relating to not stopping the drive before removing it, which then generates that error.

The solution to that is to create a batch file to run in the POST job command in Backup Exec, using the devcon utility from MS. Now i have created this bactch and tested it. The problem that im facing is that devcon comes back saying it needs to be rebooted before it can be safely removed. Now obviously this cannot happen!

How do I stop the drive without the server needing a reboot? It is USB after all!

Is there something i should run before devcon to stop all activity on the drive, or.....?

Regards,

Chester.
Avatar of dacselat
dacselat

Try to check here both utilities (freeware):

http://www.uwe-sieber.de/usbstick_e.html

- RemoveDrive
- EjectMedia

For safe removal of your drive.
Avatar of nobus
ASKER CERTIFIED SOLUTION
Avatar of dt3itsteam
dt3itsteam

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial