On Thu, 25 Jan 2007, Vaclav Barta wrote:

> On Monday 15 January 2007 16:36, Alan Stern wrote:
> > Here's another approach to try.  Get hold of the "usbreset" program, which
> > I posted here:
> >
> > http://marc.theaimsgroup.com/?l=linux-usb-users&m=116827193506484&w=2
> >
> > After plugging in your device, when the usual probing fails, do this:
> > First, run usbreset on it.  Then issue these commands:
> Doesn't really work:
> 
> # ./usbreset /proc/bus/usb/001/002
> Resetting USB device /proc/bus/usb/001/002
> Reset successful
> # ./plscsi -x '12 0 0 0 24 0' -i 36 /dev/sg0
> // sgioOpen.open: No such file or directory
> // plscsi.sclOpenNext: "/dev/sg0" not opened
> // -x0001 = -1 = plscsi.main exit int
> # ./plscsi -x '12 0 0 0 24 0' -i 36 /dev/sg1
> // sgioOpen.open: No such file or directory
> // plscsi.sclOpenNext: "/dev/sg1" not opened
> // -x0001 = -1 = plscsi.main exit int
> # blockdev --rereadpt /dev/sda
> # mount -t vfat /dev/sda1 /mnt/stick
> mount: block device /dev/sda1 is write-protected, mounting read-only
> 
> The longer sequences fail in the same way. Apparently I'm missing something - 
> could I be resetting the wrong device? The (hopefully) relevant section 
> of /proc/bus/usb/devices is
> 
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=13fe ProdID=1a21 Rev= 1.00
> S:  Manufacturer=
> S:  Product=Nu Drive
> S:  SerialNumber=075A141402A5
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

The device name was correct (the Bus number followed by the Dev#, padded
with 0's to three digits each).  It looks like you either don't have the
sg module loaded, or else your udev isn't setting up the /dev/sg[01]
device nodes correctly.

If plscsi worked before, running usbreset shouldn't prevent it from 
working.

> > Unfortunately I can't think of any way to make this happen transparently
> > in the kernel.  The stumbling block is that Linux tries to set up each
> > LUN as it is probed, whereas Windows probes all the LUNs first before
> > setting up any of them -- and the device definitely wants things done the
> > Windows way.
> Well, I could live with the commands in a script - I have to mount the 
> device, 
> so I've got to run something anyway before accessing it - the problem is I 
> can't write into it...

I'm hoping that with this sort of approach you'll find /dev/sda _does_
end up being writable.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to