Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Can't run USB twice: (3 Items)
   
Can't run USB twice  
I'm running the latest USB stack, v2.00 "J"

Problem:  I can only run it one time, then cannot run it again.  Second attempt, I get a resource busy error.

My USB script is:
________________________________________
io-usb-ehci -vvv &
sleep 5

Fsys.umass -v fsys -l -n Direct-Access=usb &
sleep 3

mount -p /dev/usb0
sleep 10

Fatfsys
________________________________________
And this script file mounts the USB drive as /dos/c.

I have tried every combination from umounting and deleting the mount points to slaying things in reverse order.  The 
best I can do is when I try to re-run the above script, Fsys.umass gets a resource busy error.  

What am I doing wrong?
Re: Can't run USB twice  
Hi Jeffrey,

Your mount sequence is correct. Most interesting is how you perform unmount.
In your case I would recommend you to try the following unmount sequence:
-------------------------
slay Fatfsys
sleep 8
umount /dev/usb0
rm -f /dev/usb0  # if you have several /dev/usbN devices try rm -f /dev/usb*
sleep 3
slay io-usb-ehci
------------------------

If this sequence would not help please provide additional information
about you system (output of the following utilities):
sin ver
sin ar
sin ir
sin
ls /dev/  (before launching mount script)
ls /dev/  (after mount script)
sin (after unmount script)

--
Regards,
Pavel


> I'm running the latest USB stack, v2.00 "J"
>
> Problem:  I can only run it one time, then cannot run it again.  Second attempt, I get a resource busy error.
>
> My USB script is:
> ________________________________________
> io-usb-ehci -vvv &
> sleep 5
>
> Fsys.umass -v fsys -l -n Direct-Access=usb &
> sleep 3
>
> mount -p /dev/usb0
> sleep 10
>
> Fatfsys
> ________________________________________
> And this script file mounts the USB drive as /dos/c.
>
> I have tried every combination from umounting and deleting the mount points to slaying things in reverse order.  The 
best I can do is when I try to re-run the above script, Fsys.umass gets a resource busy error.  
>
> What am I doing wrong?
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post89413
>
>

Re: Can't run USB twice  
Thanks.  This works perfectly!  I must have been tired that day.

What I did was to create two scripts.  The first is GO_USB.  It does all the stuff in the umount sequence, then all the 
stuff in mount sequence.  The second is STOP_USB, it only does the umount sequence.

I tested with a bunch of different USB sticks and sequences and they all worked.  I will try with other machines around 
the office and see if it fails.

Thanks a bunch for the help!

~ Jeff