Old Forum: Restore to multiple drives (jgobert)

USB Image Tool support forum
Post Reply
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

I've been looking for software that'll image a single 512MB jump drive and write that image to 400 identical drives that I have in a box. I'm running Windows 7 and have hubs in place where I can connect 16 of the drives at one time. I've used your software to create the image and successfully write it to another. Works perfectly! What I need to do now is have it loop through all of the connected drives without me needing to enter the device number in separate commands.

Is this possible?

Any help is most definitely appreciated!
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

I'm currently developing a Pro version, that will exactly do this.

If you use the command line tool, you can use it to list all devices with it's device number, redirect the console output in a file and then create a batch file out of it, where you can call the write command. This will be only one write operation active, but you won't have to start it manually.
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

Thanks for the reply. I'm actually running 12 concurrent restore operations and they all look to be successful. I threw a quick DOS batch file together to run the restore processes concurrently... I'll have to switch to VBScript to really wrap it up where I can parse the device numbers.

Right now the batch file is pretty simple... I run usbitcmd.exe l to get the device numbers and I'm updating the batch file with the new numbers before each run. The file reads:

@echo off
start /MIN usbitcmd.exe r 2204 eadmit.img /d
start /MIN usbitcmd.exe r 2332 eadmit.img /d
start /MIN usbitcmd.exe r 2460 eadmit.img /d
start /MIN usbitcmd.exe r 2588 eadmit.img /d
start /MIN usbitcmd.exe r 2716 eadmit.img /d
start /MIN usbitcmd.exe r 2844 eadmit.img /d
start /MIN usbitcmd.exe r 2972 eadmit.img /d
start /MIN usbitcmd.exe r 3100 eadmit.img /d
start /MIN usbitcmd.exe r 3228 eadmit.img /d
start /MIN usbitcmd.exe r 3356 eadmit.img /d
start /MIN usbitcmd.exe r 3484 eadmit.img /d
start /MIN usbitcmd.exe r 3612 eadmit.img /d

Each operation opens in a separate command window and run at the same time. At least for now this gets me moving in the right direction.

Thanks for your work!
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

I've gotten it up to 20 concurrent restore processes and it's working flawlessly!

I also noticed that the device numbers don't change from one set to the next. Is this behavior correct? Either way I'm pretty happy about that since I don't have to update my batch file between each run... Thanks again!
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

Hopefully I'm not annoying you with the multiple follow-up posts...

I had to swap out a few hubs as some weren't playing nice and the image time was pretty long on a few ports. Everything is running smooth now. 20 512MB drives are imaging successfully at 5min 50sec or less each time.

Out of curiosity are you interested in any metrics such as processor or memory utilization? I'd be glad to contribute as much as possible considering your tool has saved the day for me.
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

I had to make a few changes to my process... when I moved to a different PC I noticed that there would always be at least one device that didn't successfully image. If I were to execute the command again it would work... I decided to put a "pause" into the batch file so that each command would execute with 10 - 15 secs of wait time between them. I also realized that the jump drives aren't exactly top quality... many of them are a few megs smaller than the stated size so I'm using the truncate option successfully on those. To add the pause to the batch file I'm using the ping command in DOS. Here's how I have it written now... you'll see some /t switches on some lines... those are the ones that I've identified as having reduced size via the output from /l. With the batch file written as shown I've yet to encounter an error on three different PC's I've run it on.

@echo off
start /MIN usbitcmd.exe r 2360 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 2488 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 2616 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 2744 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 2872 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3000 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3128 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3256 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3384 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3512 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3640 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3768 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 3896 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4024 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4152 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4280 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4408 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4536 eadmit.img /d /t
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4664 eadmit.img /d
ping localhost -n 15 > nul
start /MIN usbitcmd.exe r 4792 eadmit.img /d /t
Alex
Site Admin
Posts: 272
Joined: Fri Jul 29, 2011 11:59 pm

Re: Old Forum: Restore to multiple drives (jgobert)

Post by Alex »

Thanks for your effort in posting your process. It's nice to see that the tool comes in useful. Just wanted to mention, that the truncate option should be used carefully, because it will not modify the file system. If you have varying flash drive sizes, you should reduce the master image size. One option is to use tools like GParted to resize the partition on the master flash drive. Good luck on your work.
rliuap
Posts: 11
Joined: Sat Apr 07, 2012 8:35 am

Re: Old Forum: Restore to multiple drives (jgobert)

Post by rliuap »

Although this is old thread, it is an interesting topic.

I played with it in a similar loop that restore the same iamge to multiple drives. I confirmed the problem that the original poster reported ("when I moved to a different PC I noticed that there would always be at least one device that didn't successfully image" -see above).

The reason for one or more drives to not be imaged is because access to the drives were denied, which is the error message.

It seems that if you try to iamge multiple drives at the same time, the first process may lock or access all other drives when (and only when) the process starts. If the second process starts while the first process locks or accesses the second drive, the second process will get an access denied error. Similarly, the second process will also lock or access all other drives when it starts, which may cause the third process to be denied... and so forth. This also explained why adding a pause between each process avoids the error but that also slows down the whole job significantly.

Similar programs like DD for Windows or Flashnul (both are open source apps) do not show this phenomenon. That is, no need to pause between loops.
Post Reply