You are not logged in.

#1 2018-09-12 07:48:27

DarthMucus
Member
Registered: 2018-08-28
Posts: 19

[SOLVED] Mounting Android phone as USB storage

Hello.

I have a problem that is very similar to this one: https://www.linuxquestions.org/question … 175610821/

My Phone is a Huawei Honor 4c.
What happens with windows when I connect my phone to it via USB is this: A "CD drive" show up that contains an installer exe for installing Huawei's HiSuite (not needed). Secondly, if I select from the phone to share the storage, a USB storage device shows up called "CHM-U01". I can access it and there's all the stuff and I can write to it as well. Easy.

In my archlinux system this happens: Once I select to share files from the phone, Enlightenment(?) automatically mounts the "CD drive" and I can see the stuff there just like in windows. Quick and easy. However what does not happen is "CHM-U01" getting automatically detected and mounted.

Just like the guy in the topic I linked, I can't find a /dev/sd* or UUID to match the "CHM-U01" USB storage device. And just like him, when I do

$ dmesg

  I get this:

[  325.253967] usb 1-1.2: new high-speed USB device number 3 using ehci-pci
[  325.351644] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1082, bcdDevice=99.99
[  325.351648] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  325.351650] usb 1-1.2: Product: CHM-U01
[  325.351652] usb 1-1.2: Manufacturer: HUAWEI
[  325.351654] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[  325.418078] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[  325.418236] scsi host6: usb-storage 1-1.2:1.1
[  325.418314] usbcore: registered new interface driver usb-storage
[  325.420491] usbcore: registered new interface driver uas
[  326.441613] scsi 6:0:0:0: CD-ROM            Linux    File-CD Gadget   0310 PQ: 0 ANSI: 2
[  326.472744] sr 6:0:0:0: Power-on or device reset occurred
[  326.474289] sr 6:0:0:0: [sr0] scsi-1 drive
[  326.474291] cdrom: Uniform CD-ROM driver Revision: 3.20
[  326.474452] sr 6:0:0:0: Attached scsi CD-ROM sr0
[  329.265618] usb 1-1.2: USB disconnect, device number 3
[  329.580628] usb 1-1.2: new high-speed USB device number 4 using ehci-pci
[  329.678364] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1082, bcdDevice=99.99
[  329.678368] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  329.678370] usb 1-1.2: Product: CHM-U01
[  329.678372] usb 1-1.2: Manufacturer: HUAWEI
[  329.678374] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[  329.679227] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[  329.679401] scsi host6: usb-storage 1-1.2:1.1
[  330.682308] scsi 6:0:0:0: CD-ROM            Linux    File-CD Gadget   0310 PQ: 0 ANSI: 2
[  330.683231] sr 6:0:0:0: Power-on or device reset occurred
[  330.684707] sr 6:0:0:0: [sr0] scsi-1 drive
[  330.684892] sr 6:0:0:0: Attached scsi CD-ROM sr0
[  367.665347] usb 1-1.2: USB disconnect, device number 4
[  386.470525] usb 1-1.2: new high-speed USB device number 5 using ehci-pci
[  386.568591] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1082, bcdDevice=99.99
[  386.568594] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  386.568597] usb 1-1.2: Product: CHM-U01
[  386.568599] usb 1-1.2: Manufacturer: HUAWEI
[  386.568601] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[  386.569722] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[  386.573309] scsi host6: usb-storage 1-1.2:1.1
[  387.588414] scsi 6:0:0:0: CD-ROM            Linux    File-CD Gadget   0310 PQ: 0 ANSI: 2
[  387.589329] sr 6:0:0:0: Power-on or device reset occurred
[  387.590615] sr 6:0:0:0: [sr0] scsi-1 drive
[  387.590808] sr 6:0:0:0: Attached scsi CD-ROM sr0
[  948.655144] ISO 9660 Extensions: Microsoft Joliet Level 1
[  948.656645] ISOFS: changing to secondary root
[ 1700.587631] usb 1-1.2: USB disconnect, device number 5
[ 1712.562523] usb 1-1.2: new high-speed USB device number 6 using ehci-pci
[ 1712.660133] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1082, bcdDevice=99.99
[ 1712.660135] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1712.660136] usb 1-1.2: Product: CHM-U01
[ 1712.660137] usb 1-1.2: Manufacturer: HUAWEI
[ 1712.660137] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[ 1712.660771] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[ 1712.665460] scsi host6: usb-storage 1-1.2:1.1
[ 1713.666587] scsi 6:0:0:0: CD-ROM            Linux    File-CD Gadget   0310 PQ: 0 ANSI: 2
[ 1713.667508] sr 6:0:0:0: Power-on or device reset occurred
[ 1713.668950] sr 6:0:0:0: [sr0] scsi-1 drive
[ 1713.669150] sr 6:0:0:0: Attached scsi CD-ROM sr0
[ 1868.518075] usb 1-1.2: USB disconnect, device number 6
[ 1868.789015] usb 1-1.2: new high-speed USB device number 7 using ehci-pci
[ 1868.886668] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1082, bcdDevice=99.99
[ 1868.886672] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1868.886675] usb 1-1.2: Product: CHM-U01
[ 1868.886677] usb 1-1.2: Manufacturer: HUAWEI
[ 1868.886679] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[ 1868.887444] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[ 1868.887889] scsi host6: usb-storage 1-1.2:1.1
[ 1869.906748] scsi 6:0:0:0: CD-ROM            Linux    File-CD Gadget   0310 PQ: 0 ANSI: 2
[ 1869.907693] sr 6:0:0:0: Power-on or device reset occurred
[ 1869.909114] sr 6:0:0:0: [sr0] scsi-1 drive
[ 1869.909656] sr 6:0:0:0: Attached scsi CD-ROM sr0

I would like to stress that simply getting over the issue of accessing my phone's storage is not my primary objective here. If at all possible I would like to understand what is going on here and why. Why is the output of dmesg repeating itself like that in the end? Is the device rapidly resetting while dmesg is doing its thing? Why is the USB device number increasing by one after every reset? Why is my phone's storage not showing up in

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk
├─sda1   8:1    0 232.5G  0 part
└─sda2   8:2    0   450M  0 part
sdb      8:16   0 298.1G  0 disk
├─sdb1   8:17   0   550M  0 part /boot
├─sdb2   8:18   0    32G  0 part /
└─sdb3   8:19   0 265.6G  0 part /home
sdc      8:32   0 931.5G  0 disk
├─sdc1   8:33   0 921.8G  0 part /mnt/storage
└─sdc2   8:34   0   9.8G  0 part
sr0     11:0    1   5.9M  0 rom

? Why is the "CD drive" only mounted but not "CHM-U01"? Why is this more complicated that simply mounting an USB stick?

Last edited by DarthMucus (2018-09-12 14:21:32)

Offline

#2 2018-09-12 08:21:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,887

Re: [SOLVED] Mounting Android phone as USB storage

Modern Androids do not use the traditional USB storage protocol for granting access to the phone storage, which is why you don't see a block device (/dev/sd*) appearing. They use a specific protocol called MTP which abstracts the underlying file system away from host (the benefit here is that you can continue using your phone/the phone's filesystem, while changing data via computer). For all intents and purposes, think of it as a network file system like SMB or NFS where you can access the files but don't have information on the actual storage the data lands on.

The downside of the matter is that MTP is a horrible protocol, with weird limitations (you can only access it from one single application and do single operations at a time, which often leads to conflicts should you use multiple applications providing MTP support).

MTP protocol implementations exist in various user space software you will want to read through https://wiki.archlinux.org/index.php/Me … r_Protocol which outlines various options for access.

Last edited by V1del (2018-09-12 08:32:09)

Offline

#3 2018-09-12 08:41:09

DarthMucus
Member
Registered: 2018-08-28
Posts: 19

Re: [SOLVED] Mounting Android phone as USB storage

Thank you for this explanation V1del. I think I understand the issue better now smile  Even though I had read that wiki page before, I mistakenly surmised that my phone simply wasn't new enough to support MTP since Android File Transfer told me it could not find a MTP device. My attempts to find out if my phone model actually used MTP or not failed.

I guess I should try those other MTP clients then like the wiki suggests.

Offline

#4 2018-09-12 14:21:07

DarthMucus
Member
Registered: 2018-08-28
Posts: 19

Re: [SOLVED] Mounting Android phone as USB storage

jmtpfs did the trick. It's slow but works. Big files are problematic though but that's MTP for you I guess. roll

Offline

Board footer

Powered by FluxBB