ayufan-pine64 / android-6.0

Main repository with Android 6.0 releases
27 stars 8 forks source link

Unable to mount USB storage device #2

Closed vially closed 7 years ago

vially commented 7 years ago

Setup

I'm using an external 500 GB external USB 3.0 drive plugged in a USB hub (the USB hub has external power source).

Steps to reproduce:

  1. Plug USB storage device in the USB hub port
  2. Open ES File Explorer
  3. Device appears in left navigation panel as: USBXXXX (with XXXX usually being 100X or 200X)
  4. At this point sometimes the Android External storage device popup appears and I select Allow. Sometimes a "Settings has stopped working" error popup appears and I select OK.
  5. Select the USBXXXX device in left panel
  6. When the ES File Explorer "Open"/"Unmount" popup appears select "Open"
  7. ES File Explorer displays error: Unable to open file. Before updating ES File Manager to latest version sometimes a different error message was displayed: "OTG USB device format not supported, only FAT32 and NTFS is supported"

I've tried formatting the drive as ext3, ext4, fat32, ntfs and all of them have the same issue. I've tried both MBR and GPT partition tables with no success. Also, I've tried opening the device in Kodi but it's not listed there either.

The exact same setup was working fine with your Android TV 5.1 image.

Logs

These are some logs taken from adb although they seem pretty generic and I don't think they'll offer much help.

logcat

12-10 08:24:53.121 25020 25020 W ResourceType: No package identifier when getting value for resource number 0x00000000
12-10 08:24:53.146 25020 25020 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
12-10 08:24:53.156 25020 25020 W System.err: com.estrongs.fs.impl.usb.UsbFsException: unsupported partition type
12-10 08:24:53.156 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.fs.b.a(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.a.b.a(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.g.p(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.g.o(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.g.c(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.g.n(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.g.h(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.e.m(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.fs.impl.usb.e.l(Unknown Source)
12-10 08:24:53.157 25020 25020 W System.err:    at com.estrongs.android.ui.c.b.f.run(Unknown Source)
12-10 08:24:53.161 25020 25020 W ResourceType: No package identifier when getting value for resource number 0x00000000
12-10 08:24:53.217  1650  1658 D gralloc : ion_alloc from ion_client:20 for 129536 Bytes uncached buffer by using heap mask 16 successfully, mem_continue_flag is 1
12-10 08:24:53.220  1650  1660 D gralloc : ion_alloc from ion_client:20 for 129536 Bytes uncached buffer by using heap mask 16 successfully, mem_continue_flag is 1
12-10 08:24:53.220  1650  1660 D gralloc : ion_alloc from ion_client:20 for 129536 Bytes uncached buffer by using heap mask 16 successfully, mem_continue_flag is 1
12-10 08:24:53.221  1650  1660 D gralloc : ion_alloc from ion_client:20 for 129536 Bytes uncached buffer by using heap mask 16 successfully, mem_continue_flag is 1
12-10 08:24:55.470  2965  3727 D WifiConfigStore: Retrieve network priorities after PNO.
12-10 08:24:56.248  1669  2594 D audio_hw_primary: out_standby
12-10 08:24:56.931 19183 19450 E chromium: [19183:19450:ERROR:wifi_frame_histogram_capturer.cc(405)] No histogram or IOCTL data
12-10 08:24:56.932 19183 19450 I chromium: [19183:19450:INFO:wifi_util.cc(111)] Current wifi TDLS peers:
12-10 08:24:56.932 19183 19450 I chromium: [19183:19450:INFO:wifi_util.cc(113)]     No peers:
12-10 08:24:57.356 19183 19183 I chromium: [19183:19183:INFO:metrics_util.cc(51)] Record action: Cast.CecHdmiInputState.Unknown
12-10 08:24:57.357 19183 19183 I chromium: [19183:19183:INFO:metrics_util.cc(51)] Record action: Cast.CecStandby.Unknown
12-10 08:24:58.925 19183 19738 I chromium: [19183:19738:INFO:ssdp_device.c(101)] SSDP packets sent for 120 seconds = 4
12-10 08:25:02.946  2965  3019 E KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat: open failed: ENOENT (No such file or directory)
12-10 08:25:10.478  2965  3727 D WifiConfigStore: Retrieve network priorities after PNO.

dmesg

[22324.805651] usb 2-1.1.1: USB disconnect, device number 6
[22331.852226] usb 2-1.1.1: new high-speed USB device number 7 using sunxi-ehci
[22332.061066] usb 2-1.1.1: New USB device found, idVendor=0080, idProduct=a001
[22332.068917] usb 2-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[22332.077255] usb 2-1.1.1: Product: External USB 3.0
[22332.082752] usb 2-1.1.1: Manufacturer: TOSHIBA
[22332.087679] usb 2-1.1.1: SerialNumber: 2015033100063
[22332.099892] usb-storage 2-1.1.1:1.0: USB Mass Storage device detected
[22332.107364] scsi3 : usb-storage 2-1.1.1:1.0
[22333.094194] scsi 3:0:0:0: Direct-Access     TO Exter nal USB 3.0      0203 PQ: 0 ANSI: 6
[22333.120427] sd 3:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[22333.136646] sd 3:0:0:0: [sda] Write Protect is off
[22333.143253] sd 3:0:0:0: [sda] Mode Sense: 47 00 00 08
[22333.151070] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[22333.233794]  sda: sda1
[22333.253231] sd 3:0:0:0: [sda] Attached SCSI disk
[22333.343282] RTL871X: nolinked power save leave
[22334.556907] sd 3:0:0:0: [sda] Synchronizing SCSI cache
[22334.638688] RTL871X: nolinked power save enter
[22342.171991] healthd: battery none chg=a 2016-12-10 16:13:19.007671711 UTC
ayufan commented 7 years ago

Can you do sfdisk dump (and equivalent for GPT)?

vially commented 7 years ago

This is the output of sfdisk --dump:

label: dos
label-id: 0x0f475a66
device: /dev/sdb
unit: sectors

/dev/sdb1 : start=        2048, size=   976771072, type=7

Edit

It seems the disk gets recognized after setting the partition table to MBR and formatting it as a single NTFS partition as listed above.

Now when I plug it in, an Android popup appears (I'm using the TV image) asking me how I would like to use the disk: "internal storage"/"removable device". So I select removable device and it asks me to format it which I confirm. So after letting Android format it the sfdisk --dump looks like this (which seems to be MBR with one big FAT32 partition with the boot and lba flags set):

label: dos
label-id: 0x00000000
device: /dev/sdb
unit: sectors

/dev/sdb1 : start=        2048, size=   976771120, type=c, bootable

So now the disk gets recognized correctly and I can browse files in ES File Manager, however, I can't find the device in Kodi. Any idea why that might happen?

Also, what is the default mount point for USB devices? Is it /storage/PARTITION-ID?

ayufan commented 7 years ago

I have heard about Kodi problem, not recognising USB drives. Can you write more? Maybe you could look in Kodi source code to see what happens there and how they do discover external drives?

vially commented 7 years ago

I'm looking further into it. I'll update this issue with the progress if I find anything.

ayufan commented 7 years ago

This is fixed in latest build.