• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mounting and Dismounting (USB Drive) Volumes

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing a Java application to perform mass copying of files to many USB drive devices connected to a Windows PC via daisy chained USB hubs. The copy operation will be performed on as many USB drive devices as I can get to work simultaneously. (It looks like 127 ports per root on the PC, so at least this many simultaneous copy operations, performed repetitively over hundreds to thousands of USB drive devices in total.) While testing with a simple thumb drive on a Windows XP PC, inserting and removing the drive does not seem to require a formal "mount" and "dismount" action. However, Windows has a "Safely Remove Hardware" wizard, I presume for a reason (maybe not...) and I suspect performing this operation many times in a session as envisioned will cause problems with the OS. Can anyone comment on the need to formally mount or dismount large numbers of USB drive devices in a scenario like this? If mounting and dismounting is required, can you also please comment on the methods to use in Java, comparing alternatives if any. Many thanks for the help.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bill Denniston wrote:However, Windows has a "Safely Remove Hardware" wizard, I presume for a reason (maybe not...)


Windows has two speed settings for external drives: optimized for performance and optimized for safe removal.

The latter is default for (most) new devices. It means that data that is written to the device directly. Removing the device without unmounting will cause no problems, but speed is limited. I've never got much more than about 5MB/s.

The former usually needs to be set manually through device manager. Data is written to a buffer inside Windows first; Windows will then gradually flush this buffer to the device. While the performance gain is significant (I got up to 25-30MB/s, a gain of over 400%) it does come at a cost. Removing the device without unmounting will cause any unflushed buffer contents to be discarded. It may even mess up the device's entire file system. Definitely not recommended.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic