Re: problem with USB-CD drive

From: Eugene Grosbein <eugen_at_grosbein.net>
Date: Wed, 02 Mar 2022 04:23:11 UTC
21.02.2022 17:44, Wojciech Puchar wrote:

> i can read sectors by dd, by single (bs=2k) or multiple.
> Other communication (vendor specific SCSI commands - used to configure/control the device with our software) - works properly. 
> If i make an image (first 34 sectors, device presents itself as 16MB
> to prevent problems with some OSes but everything later are zeros) - it is good - did cmp with original image file.
> 
> i can do mdconfig, mount_cd9660 on this file and everything is fine.
> 
> 
> BUT
> 
> mount_cd9660 /dev/cd1 /mnt
> 
> results in:
> 
> mount_cd9660: /dev/cd1: Invalid argument
> 
> There is no kernel messages.
> 
> How could i find out what is exactly a problem?

It looks like the device or driver do not like size of reading request,
f.e. short read. It should be possible to verify that using several ways:

1) run "ktrace -i mount_cd9660 ..." then study ouput of kdump;
2) enable debug logs at GEOM level, use sysctl kern.geom.debugflags=255
(beware of large amount of logs) then run mount_cd9660
3) use gcache(8) that is capable of limiting minimum request size by caching "extra" data,
but try using only single gcache(8) instance per system because of known instability in the gcache code
when you create multiple geom_cache's.