Bug #3052

Usb devices aren't mounted.

Added by Gabe Smith about 5 years ago. Updated almost 5 years ago.

Status:FixedStart date:04/05/2016
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

0%

Category:Filesystem
Target version:5.2
Found in version:5.020.g77723, STOS 2.4.7.g0b166 Platform:RPi

Description

Usb devices aren't mounted on Raspberry PI Zero. Tested on Kingmax 16 GB FAT32 usb drive connected to a 3-Port Usb hub and a network adapter port(Realtek 8153 which works). Attached logs.

blkid.txt Magnifier - blkid output (186 Bytes) Gabe Smith, 04/05/2016 08:42 PM

dmesg.txt Magnifier - dmesg output (12.2 KB) Gabe Smith, 04/05/2016 08:42 PM

lsusb.txt Magnifier - lsusb output (132 Bytes) Gabe Smith, 04/05/2016 08:42 PM

mount.txt Magnifier - mount output (870 Bytes) Gabe Smith, 04/05/2016 08:42 PM

udevadm.txt Magnifier - udevadm info on Kingmax usb drive (657 Bytes) Gabe Smith, 04/05/2016 08:42 PM

movian-0.log - Movian log (11.2 KB) Gabe Smith, 04/05/2016 08:44 PM

udevadm monitor --environment.txt Magnifier (1.78 KB) Gabe Smith, 04/06/2016 05:07 PM

lsmod_before_after.txt Magnifier (988 Bytes) Gabe Smith, 04/13/2016 08:12 PM

udevadm-monitor.txt Magnifier (8.76 KB) Gabe Smith, 04/13/2016 08:16 PM


Related issues

Related to Bug #3128: Pi Zero does not see mounted USB sticks Fixed 05/05/2016

Associated revisions

Revision 6598da92
Added by Andreas Smas almost 5 years ago

rpi: Upgrade STOS to fix problem with unmountable USB drives

Fixes #3052
Fixes #3128

Change included in version 5.0.263

History

#1 Updated by Andreas Smas about 5 years ago

  • Status changed from New to Need feedback
  • Target version set to 5.2

Thanks for this, seems that the udev rules does not pick up the drive.

In STOS:

$ cat ./etc/udev/rules.d/81-usbdisk.rules
ENV{ID_FS_USAGE}=="filesystem", ENV{ID_BUS}=="usb", ACTION=="add",    RUN+="/usr/sbin/usbfs.sh add" 
ENV{ID_FS_USAGE}=="filesystem", ENV{ID_BUS}=="usb", ACTION=="remove", RUN+="/usr/sbin/usbfs.sh remove" 

According to output from your udevadm ID_FS_USAGE is not set, i wonder why?

On my system, if I tail -f /var/log/syslog during insert I see:

Apr  5 19:46:11 kernel: [ 5654.455563] usb 1-1.4: new high-speed USB device number 7 using dwc_otg
Apr  5 19:46:11 kernel: [ 5654.558341] usb 1-1.4: New USB device found, idVendor=090c, idProduct=1000
Apr  5 19:46:11 kernel: [ 5654.558358] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr  5 19:46:11 kernel: [ 5654.558371] usb 1-1.4: Product: Flash Disk
Apr  5 19:46:11 kernel: [ 5654.558381] usb 1-1.4: Manufacturer: USB
Apr  5 19:46:11 kernel: [ 5654.558391] usb 1-1.4: SerialNumber: FBD1004264501125
Apr  5 19:46:11 kernel: [ 5654.559286] usb-storage 1-1.4:1.0: USB Mass Storage device detected
Apr  5 19:46:11 kernel: [ 5654.561199] scsi host2: usb-storage 1-1.4:1.0
Apr  5 19:46:13 kernel: [ 5656.473094] scsi 2:0:0:0: Direct-Access     USB      Flash Disk       1100 PQ: 0 ANSI: 0 CCS
Apr  5 19:46:13 kernel: [ 5656.475425] sd 2:0:0:0: [sda] 489472 512-byte logical blocks: (251 MB/239 MiB)
Apr  5 19:46:13 kernel: [ 5656.476121] sd 2:0:0:0: [sda] Write Protect is off
Apr  5 19:46:13 kernel: [ 5656.476144] sd 2:0:0:0: [sda] Mode Sense: 43 00 00 00
Apr  5 19:46:13 kernel: [ 5656.477035] sd 2:0:0:0: [sda] No Caching mode page found
Apr  5 19:46:13 kernel: [ 5656.477078] sd 2:0:0:0: [sda] Assuming drive cache: write through
Apr  5 19:46:13 kernel: [ 5656.484788]  sda:
Apr  5 19:46:13 kernel: [ 5656.487172] sd 2:0:0:0: [sda] Attached SCSI removable disk
Apr  5 19:46:13 user: root: usbfs.sh add /dev/sda UUID: 1021-0307
Apr  5 19:46:13 user: movian.stripped: Automount       [DEBUG]: Got notification
Apr  5 19:46:13 user: movian.stripped: Automount       [DEBUG]: Added filesystem stick at /dev/sda (vfat) [1021-0307]
Apr  5 19:46:13 user: movian.stripped: Automount       [DEBUG]: Mounted /dev/sda at /stos/media/stick

I suppose you don't even see the user: root: usbfs.sh add /dev/sda UUID: 1021-0307 line in your syslog?

#2 Updated by Gabe Smith about 5 years ago

I can only see this:
Apr 6 14:55:32 kernel: [ 130.263176] usb 1-1.4: new high-speed USB device number 5 using dwc_otg
Apr 6 14:55:32 kernel: [ 130.366611] usb 1-1.4: New USB device found, idVendor=1687, idProduct=3261
Apr 6 14:55:32 kernel: [ 130.366649] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 6 14:55:32 kernel: [ 130.366663] usb 1-1.4: Product: USB3.0 FlashDisk
Apr 6 14:55:32 kernel: [ 130.366677] usb 1-1.4: Manufacturer: Kingmax
Apr 6 14:55:32 kernel: [ 130.366692] usb 1-1.4: SerialNumber: 17130808020000000087

#3 Updated by Gabe Smith about 5 years ago

udevadm monitor --environment output attached when inserting usb flash drive.

#4 Updated by Andreas Smas almost 5 years ago

  • Status changed from Need feedback to Accepted

I have no idea how to fix this really. I'm not a good enough expert on udev to figure this out.

#5 Updated by Gabe Smith almost 5 years ago

I'll try stos rpi on an Raspberry Pi 2 soon to see if it has the same problem. I see that my problem isn't singular:
https://movian.tv/boards/23/topics/10142
I've asked on that topic to see what was the last version that worked for Nikos.

#6 Updated by Gabe Smith almost 5 years ago

I'll try older versions, can I just replace the showtime.sqfs with showtime-version_number.sqfs from rpi builds?

#7 Updated by Andreas Smas almost 5 years ago

Gabe Smith wrote:

I'll try older versions, can I just replace the showtime.sqfs with showtime-version_number.sqfs from rpi builds?

Yes, but you should put it in /stos/persistent/packages directory (the second partition on the SD card)

The system will try to start with that version before it falls back to the one on the first partition. (ie, this is where the update goes)

#8 Updated by Gabe Smith almost 5 years ago

Well, I've tried older versions now, but no success. I probably need to try older stos images. Could you make an stos image for rpi which has Raspberry Pi Zero firmware in it, but have older version of stos(meaning older kernel & rootfs probably) than the version which was current on 16.01.2016 ?

#9 Updated by Gabe Smith almost 5 years ago

I've tried sd-2.1.4.img(I've replaced rootfs.sqfs,firmware.sqfs, modules.sqfs, kernel.img,showtime.sqfs on /boot partition) which has showtime 4.10.3.g00a2e & updated to 4.10.38.ge911f & that recognizes the usb drive. After I upgrade to 5.0.75.g3305f usb drive is gone.

#10 Updated by Andreas Smas almost 5 years ago

So basically, what you are saying is that with an older kernel version it works ok?

#11 Updated by Terb Terbich almost 5 years ago

Same problem on my Rpi model B.
When I plug any usb drive i've got only this:

Apr 13 14:54:51 kernel: [ 1263.440811] usb 1-1.2: new high-speed USB device number 8 using dwc_otg
Apr 13 14:54:51 kernel: [ 1263.543243] usb 1-1.2: New USB device found, idVendor=8564, idProduct=1000
Apr 13 14:54:51 kernel: [ 1263.543278] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 13 14:54:51 kernel: [ 1263.543293] usb 1-1.2: Product: Mass Storage Device
Apr 13 14:54:51 kernel: [ 1263.543303] usb 1-1.2: Manufacturer: JetFlash
Apr 13 14:54:51 kernel: [ 1263.543315] usb 1-1.2: SerialNumber: 44UIUK4FO2L3J8TL

#12 Updated by Gabe Smith almost 5 years ago

Yes, stos 2.1.4 was the last working version. 2.2 doesn't work.
This one was the last working:
https://movian.tv/projects/stos/repository/revisions/c9402ecc3b6d3c46808c481e6fd70bf956a5ab97
This doesn't work anymore:
https://movian.tv/projects/stos/repository/revisions/a83968f36cb00d5cc8888e456c6104bd4cfcd756
So something changed between those two revisions that broke usb udev.

#13 Updated by Gabe Smith almost 5 years ago

Maybe this is the problem, in new kernel config is set: BR2_PACKAGE_EUDEV_ENABLE_HWDB=y in config/buildroot-rpi-release.config.

#14 Updated by Andreas Smas almost 5 years ago

Gabe Smith wrote:

Maybe this is the problem, in new kernel config is set: BR2_PACKAGE_EUDEV_ENABLE_HWDB=y in config/buildroot-rpi-release.config.

BR2_PACKAGE_EUDEV_ENABLE_HWDB is a new option but default on to preserve old behavior. So it used to be implicitly on before, just that you can turn it off now to save space in rootfs, see this commit: http://lists.busybox.net/pipermail/buildroot/2015-June/130390.html

My bet is still the kernel because of the upgrade from 3.18 to 4.1.

When I did the upgrade I needed to recreate the kernel config files because they really didn't upgrade themselves.

So something critical probably fell out. I'll try to have a look

#15 Updated by Andreas Smas almost 5 years ago

Can you try to do lsmod on the working older system before and after USB insert to see if it loads some kernel module?

#16 Updated by Gabe Smith almost 5 years ago

Lsmod output is the same before and after insert(attached)
Attached udevadm monitor --environment output when inserting usb flash drive.

#17 Updated by Andreas Smas almost 5 years ago

I'm still clueless here :-(

#18 Updated by Andreas Smas almost 5 years ago

  • Related to Bug #3128: Pi Zero does not see mounted USB sticks added

#19 Updated by Dmitry Petrov almost 5 years ago

First what I would try is replacing power supply for a better one and of course measured current/voltage.

#20 Updated by Gabe Smith almost 5 years ago

I have an original power supply 5V/2A that came with Raspberry Pi & I use it for Raspberry Pi Zero.
Well, I think we have established that the change to kernel 4.1 made the Raspberry Pi not to recognize usb drives. Can't anybody from the Raspberry Pi foundation help?

#21 Updated by Andreas Smas almost 5 years ago

  • Status changed from Accepted to Rejected

I've no idea how to progress here. Someone with a non-working USB device should try to compile STOS and figure out what's wrong.

#22 Updated by Gabe Smith almost 5 years ago

I could try compiling stos. Where can I find instructions on how to do it?

#23 Updated by Andreas Smas almost 5 years ago

It should be pretty easy

first clone https://github.com/andoma/stos

then make sure you have all the dependencies installed as seen in https://github.com/andoma/stos/blob/master/.doozer.json (this is what the builtbot uses when staging the build environment)

Then you should only have to do

./build.sh -j8 rpi release build

(8 is the number of CPU cores on your machine for optimal parallel build)

#24 Updated by Andreas Smas almost 5 years ago

btw, i've only used Ubuntu 14.04 (64bit) when building this. Any later debian-ish system should work i guess. Otherwise you need to figure out what the dependencies/packages are called on your system.

#25 Updated by Gabe Smith almost 5 years ago

Can you upgrade kernel to 4.4 & see if the problem still exists?

#26 Updated by Gabe Smith almost 5 years ago

I managed to find the bug. In kernel-rpi-release.config CONFIG_USB_STORAGE=y is missing.
https://github.com/andoma/stos/blob/master/config/kernel-rpi-release.config
Please fix it.

#27 Updated by Andreas Smas almost 5 years ago

Auch, thanks for finding this. It's weird that some devices work OK though?

#28 Updated by Gabe Smith almost 5 years ago

RPI 2 worked because it has a different kernel config.

#29 Updated by Andreas Smas almost 5 years ago

  • Status changed from Rejected to Fixed

Gabe Smith wrote:

RPI 2 worked because it has a different kernel config.

Yeah, too bad I didn't realised that earlier. I did all my testing on rpi2, I thought rpi-zero also used the newer BCM chips

Also available in: Atom PDF