[RESOLVED] I get KERN : usb_disk : unrecovered read error after package install - suspecting package 'libusb'

Ahoy folks,

Seems finally I could reduce to one suspected package which can cause usb_disk read errors on my Haiku USB key installs

→ as it strongly USB related
→ the well known error messages for me appeared only AFTER, when I issued the following install portion of packages

pkgman install dillo_plus dooble epiphany falkon httrack kristall ladybird links lynx netsurf otter_browser qupzilla qutebrowser retawq w3m webkit_gtk_demo zeal

the suspected package is libusb,

precisely libusb-1.0.26-2-x86_64.hpkg

~> pkgman search libusb
Status  Name                  Description                                                                          
-------------------------------------------------------------------------------------------------------------------
        hamlib                Ham radio backend rig control library                                                
        hxcfloppyemulator     Command-line tools for the HxC floppy emulator                                       
        libgusb               Glib wrapper around libusb1                                                          
        libgusb_devel         Glib wrapper around libusb1 (development files)                                      
        libgusb_source        Glib wrapper around libusb1 (source files)                                           
S       libusb                A library that provides generic access to USB devices                                
        libusb_compat         An API wrapper for libusb                                                            
        libusb_compat_devel   An API wrapper for libusb (development files)                                        
        libusb_compat_source  An API wrapper for libusb (source files)                                             
        libusb_debuginfo      A library that provides generic access to USB devices (debug info)                   
        libusb_devel          A library that provides generic access to USB devices (development files)            
        libusb_docs           A library that provides generic access to USB devices                                
        libusb_examples       A library that provides generic access to USB devices                                
        libusb_source         A library that provides generic access to USB devices (source files)                 
        libusbmuxd            A client library to multiplex connections from and to iOS devices                    
        libusbmuxd_debuginfo  A client library to multiplex connections from and to iOS devices (debug info)       
        libusbmuxd_devel      A client library to multiplex connections from and to iOS devices (development files)
        libusbmuxd_source     A client library to multiplex connections from and to iOS devices (source files)     


Seems it is dependency for Web/Epiphany

~> pkgman uninstall libusb
The following changes will be made:
  in system:
    uninstall package epiphany-43.1-1
    uninstall package gcr-3.41.1-3
    uninstall package gnupg-2.4.3-1
    uninstall package libusb-1.0.26-2
Continue? [yes/no] (yes) : no
~> 

Errors in syslog BEFORE these packages installed :

~> grep -E -i error /boot/system/var/log/syslog | grep -E -v -i deferred
2024-04-02 09:26:45 USER: Error in AllUnarchived method of object of type 5BView
2024-04-02 09:26:45 USER: An error occured during unarchival, cleaning up.
2024-04-02 09:26:46 DAEMON 'DHCP': /dev/net/iprowifi4965/0: DHCP status = No error
~> 
~> 
~> 
~> 
~> df -h
 Mount             Type      Total     Free      Flags   Device
----------------- --------- --------- --------- ------- ------------------------
/boot             bfs        14.0 GiB   8.8 GiB QAM-P-W /dev/disk/usb/0/0/0
/boot/system      packagefs   4.0 KiB   4.0 KiB QAM-P-- 
/boot/home/config packagefs   4.0 KiB   4.0 KiB QAM-P-- 
/boot/system/var/shared_memory 
                  ramfs             0  30.8 GiB QAM-PRW 
/BFS_DL           bfs        15.2 GiB  11.9 GiB QAM-P-W /dev/disk/usb/0/0/2
~> 
~> 
~> 
~> 
~> pkgman install dillo_plus dooble epiphany falkon httrack kristall ladybird links lynx netsurf otter_browser qupzilla qutebrowser retawq w3m webkit_gtk_demo zeal


Errors in syslog AFTER these packages installed :

[system] Applying changes ...
[system] Changes applied. Old activation state backed up in "state_2024-04-02_09:50:46"
[system] Cleaning up ...
[system] Done.
~> 
~> grep -E -i error /boot/system/var/log/syslog | grep -E -v -i deferred
2024-04-02 09:26:45 USER: Error in AllUnarchived method of object of type 5BView
2024-04-02 09:26:45 USER: An error occured during unarchival, cleaning up.
2024-04-02 09:26:46 DAEMON 'DHCP': /dev/net/iprowifi4965/0: DHCP status = No error
2024-04-02 09:51:12 KERN: usb error ehci 2: qtd (0x84ae00) error: 0x2c008d40
2024-04-02 09:51:12 KERN: usb_disk: request_sense: key: 0x03; asc: 0x11; ascq: 0x00; Unrecovered read error
2024-04-02 09:51:12 KERN: usb_disk: block read failed when filling partial buffer: I/O error
2024-04-02 09:51:12 KERN: usb_disk: read failed: I/O error
2024-04-02 09:51:12 KERN: unknown: [1563096623:  1507] ReadFileData(4763615, 0xffffffffb7490000, 10947) failed to read data: I/O error
~> 


Had someone experienced similar USB errors who installed Web / Epiphany browser ?

Is there someone - with an earlier version of libusb - that not cause such errors above with latest R1B4 64 bit Haiku ?

1 Like

usb_disk read error means your USB drive is damaged and some sector cannot be read anymore. It has nothing to do with any specific packages. Get a working USB drive before you start losing important data.

libusb is not used at all for this and completely unrelated. Maybe it happens to be using one of the damaged sectors on your USB disk.

I would recommend using an actual hard disk or SSD for Haiku instead of an USB one. USB thumb drives are rarely made to sustain use as the main storage for an operating system, with pretty much continuous reads and writes all day long. If you really want to use USB storage, try to get a higher quality one.

1 Like

I’ve had a few random usb disk failures over the years with haiku, they work fine then one day just expire. I haven’t seen that failure in sometime but i no longer daily drive haiku because of my current software needs. I’d search track for a ticket i remember seeing a usb disk corruption ticket some years back. Worth a look

Just checked my syslog and I didn’t find any similar errors. I have Web / Epiphany installed, and I run Haiku directly off USB. (Being able to run off USB is the only way I can use Haiku regularly, makes it easy to switch operating systems.)

I’ve had a lot of luck with Samsung “Bar” USB 3.1 128GB/256GB 400MB/s flash drives, the weirdly shaped ones. They’ve worked fine with both Linux and Haiku for the last few months I’ve been working that way. I suppose a Samsung T7 External SSD might also be an option, but that’s more bulky, more expensive, and far more disk space than Haiku needs.

I wonder how small and light an external SSD can get.

Something like this? Size of a pack of gum.

2 Likes

Thanks for the answers - to all of you.

I suspected libusb, as I experienced so I install “something” and after Haiku becomes unreliable toward my this and another Kingston thumbdrives.
Now I installed packages, systematically, in portions to catch the moment the flacky package installed - main or dependency - and find something among them that relates to USB.

Of course the explanation
as the used area reaches the swacky part of my drive during installations finally - is reasonable from one side… however I do not understan a bit …
Shouldn’t the storage controller logic on the key avoid such cases
doing actions
the affected storage units replace with working from the spared ones ?
also reporting those to the OS ?
So huge could be that - in my case - … it cannot be avoided ?

Anyway,
thanks again for your answers.

This is exactly what it does: it tell you “I could not read or write your data, the hardware is defective”. That is the very message you are seeing.

How many spare do you think the USB key manufacturer is willing to ship? 10% ? 50% ? Would they put a 32GB flash memory and only allow to use 32MB so you have a lot of spares to continue to use it as flash sectors go bad?

This is why I recommended to get a high quality USB disk. Some are better designed than others, either in flash memory technologies (ranging from SLC - storing one bit per transistor) to MLC (storing up to 4 bits last time I looked, by having the transistor not fully switched to a “0” or “1” state but somewhere in the middle) ; or in controller implementation (error detection and correction algorithms, number of spare sectors, …).