dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

Persistence with USB 3.0 device #575

Closed drinkcat closed 9 years ago

drinkcat commented 10 years ago

So, I got that new fancy USB 3.0 stick to use with my Samsung Chromebook ARM, but I’m facing an issue with persistence on the USB 3.0 port. USB 2.0 port works as expected.

croutonversion:

crouton: version git (that’s chroagh actually)
release: alarm
architecture: armv7h
host: version 4731.101.0 (Official Build) stable-channel daisy

Plug in USB 2.0 port, dmesg output:

[  181.242031] usb 1-1: new high-speed USB device number 4 using s5p-ehci
[  181.373959] usb 1-1: New USB device found, idVendor=0781, idProduct=5580
[  181.373995] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  181.374023] usb 1-1: Product: Extreme
[  181.374044] usb 1-1: Manufacturer: SanDisk
[  181.374066] usb 1-1: SerialNumber: AA010304132354502307
[  181.376587] scsi0 : usb-storage 1-1:1.0
[  182.377851] scsi 0:0:0:0: Direct-Access     SanDisk  Extreme          0001 PQ: 0 ANSI: 6
[  182.382748] sd 0:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[  182.383573] sd 0:0:0:0: [sda] Write Protect is off
[  182.383589] sd 0:0:0:0: [sda] Mode Sense: 33 00 00 08
[  182.384443] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  182.390322]  sda: sda1
[  182.397562] sd 0:0:0:0: [sda] Attached SCSI disk
[  183.076566] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:

Then enter-chroot:

sudo sh /media/removable/USB\ Drive/local/bin/enter-chroot

Now suspend the machine (close lid), wake it up, chroot still works, and nothing remarkable in dmesg:

[  298.516998] usb 1-1: reset high-speed USB device number 4 using s5p-ehci

All good.

Now, connecting the device on the USB 3.0 port:

[  406.967417] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd
[  406.984096] usb 4-1: New USB device found, idVendor=0781, idProduct=5580
[  406.984179] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  406.984249] usb 4-1: Product: Extreme
[  406.984300] usb 4-1: Manufacturer: SanDisk
[  406.984351] usb 4-1: SerialNumber: AA010304132354502307
[  406.988434] scsi1 : usb-storage 4-1:1.0
[  407.987575] scsi 1:0:0:0: Direct-Access     SanDisk  Extreme          0001 PQ: 0 ANSI: 6
[  407.988524] sd 1:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[  407.988912] sd 1:0:0:0: [sda] Write Protect is off
[  407.988926] sd 1:0:0:0: [sda] Mode Sense: 33 00 00 08
[  407.989867] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  407.995339]  sda: sda1
[  407.997427] sd 1:0:0:0: [sda] Attached SCSI disk
[  408.551535] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:

enter-chroot, then close the lid. On the way back, the chroot is unusable:

$ ls
-bash: /usr/bin/ls: No such file or directory

And this in dmesg:

[  498.022090] usb 4-1: USB disconnect, device number 2
[  498.043808] sd 1:0:0:0: [sda] Synchronizing SCSI cache
[  498.043908] sd 1:0:0:0: [sda]  Result: hostbyte=0x01 driverbyte=0x00
[  498.046378] xHCI xhci_drop_endpoint called with unaddressed device
[  498.046388] xHCI xhci_drop_endpoint called with unaddressed device
[  498.046396] xHCI xhci_check_bandwidth called with unaddressed device
[  498.052525] xHCI xhci_free_dev called with unaddressed device
[  498.282083] usb 4-1: new SuperSpeed USB device number 3 using xhci-hcd
[  498.297783] usb 4-1: New USB device found, idVendor=0781, idProduct=5580
[  498.297795] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  498.297804] usb 4-1: Product: Extreme
[  498.297811] usb 4-1: Manufacturer: SanDisk
[  498.297817] usb 4-1: SerialNumber: AA010304132354502307
[  498.307098] scsi2 : usb-storage 4-1:1.0
[  499.307467] scsi 2:0:0:0: Direct-Access     SanDisk  Extreme          0001 PQ: 0 ANSI: 6
[  499.311696] sd 2:0:0:0: [sdb] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[  499.312283] sd 2:0:0:0: [sdb] Write Protect is off
[  499.312294] sd 2:0:0:0: [sdb] Mode Sense: 33 00 00 08
[  499.312794] sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  499.315296]  sdb: sdb1
[  499.316797] sd 2:0:0:0: [sdb] Attached SCSI disk
[  500.042549] EXT4-fs (sdb1): recovery complete
[  500.044215] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: 
[  500.420156] EXT4-fs error (device sda1): ext4_find_entry:935: inode #786456: comm bash: reading directory lblock 0

The USB stick gets mapped to a new device (sdb), mounted a new location (/media/removable/USB Drive 1), and lots of mount points are left behind by crouton.

Related to #288 (and http://crbug.com/208380), but not quite the same thing... ext4 without journal does not fix the problem: the issue is at a lower level it seems.

Another device that is only USB 2.0 capable works on both ports (I've notice some strangeness that looks more like #288, but the chroot was always kept alive).

power/persist in the relevant sysfs directory is set to 1, as expected.

If somebody has any suggestions...

dnschneid commented 9 years ago

Is this still an issue?

drinkcat commented 9 years ago

Well, my Samsung ARM is locked in a drawer halfway around the world....

I think this might have been on kernel 3.4, so maybe it is fixed with kernel 3.8. I'll open a crbug if necessary.

tedm commented 9 years ago

This might be a Chrome issue, as I have a Satechi USB 3 Ethernet (wired) adapter, which is also a 3 pot USB 2/3 hub. With no chroot running, just Stable Chrome on the Samsung 2012 ARM, resuming in the USB 3 port by lifting up the lid, may require me to pull out and re-insert the adapter. But in the USB 2 port, it appears to resume OK. Again, this is WITHOUT a chroot running, so either a Chromium OS issue, or an incompatibility with this specific USB 3 device.

promanczuk commented 9 years ago

Hi,

I am having maybe a related issue with a SanDisk USB 3.0 formatted with ext4. It keeps remounting randomly during normal continuous operation in Chrome OS.

I am for example unable to do any backups on my chroot as it keeps randomly umounting/remountig during the process. On the other hand, a backup on a Lexar USB 2.0 (I think FAT32) seems to work flawlesly no remounts.

I guess it seems to be a Chrome OS problem.