Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I access a smartfones internal storage?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
as.gentoo
Guru
Guru


Joined: 07 Aug 2004
Posts: 318

PostPosted: Sat May 06, 2017 2:46 am    Post subject: How do I access a smartfones internal storage? Reply with quote

Hello,
I want to drag some files from my new smartfones internal memory to my box. The phone has no SD card.
I conected the phone to my box but there was no drive added.

Here is what I get in the logs when I establish the connection
Code:
May 04 09:55:28 [kernel] [77444.847293] usb 2-2: new high-speed USB device number 22 using ehci-pci
May 04 09:55:28 [kernel] [77444.969896] usb 2-2: New USB device found, idVendor=1234, idProduct=f000
May 04 09:55:28 [kernel] [77444.969900] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 04 09:55:28 [kernel] [77444.969902] usb 2-2: Product: Android
May 04 09:55:28 [kernel] [77444.969904] usb 2-2: Manufacturer: Android
May 04 09:55:28 [kernel] [77444.969907] usb 2-2: SerialNumber: abcdefgh
May 04 09:55:28 [kernel] [77444.973158] usb-storage 2-2:1.0: USB Mass Storage device detected
May 04 09:55:28 [kernel] [77444.973373] scsi host16: usb-storage 2-2:1.0
[...]
May 06 03:53:11 [kernel] [77446.032389] scsi 16:0:0:0: Direct-Access     Linux    File-CD Gadget   0000 PQ: 0 ANSI: 2
May 06 03:53:11 [kernel] [77446.039020] sd 16:0:0:0: [sdc] Attached SCSI removable disk
It explicitly says "USB Mass Storage device detected" and "[sdc] Attached SCSI removable disk". When I checked for /dev/sdc there was no such device. 'lsblk' didn't show it either.

I just checked my old phone and it shows quite the same in the logs (right when the power is turned on). But, it does not show the option "MTP" (media transfer protocol?) and "mount SD card" in the GUI when the phone has booted. It looks like there is a bug in the new phones GUI regarding the latter.
An eix "media transfer" shows
Code:
media-libs/libmtp
     webpage:             http://libmtp.sourceforge.net/
     desc:           An implementation of Microsoft's Media Transfer Protocol (MTP)
     license:                 LGPL-2.1
If I got that right it only allows to transfer some specific file types. I couldn't find out if this could access files on a phones internal storage anyways.
An then I'd be happier if the kernel could offer something like that. There is
Code:
Direct-Access     Linux    File-CD Gadget
in the message above and I thought I'd need to activate an USB gadget option first, but the other phone shows
Code:
Direct-Access     ABC      Android Phone
at the same place, so that just seems to be a name coming from the phone… :roll:

Do you know an other way?
Thanks in advance!
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 309

PostPosted: Sat May 06, 2017 2:56 am    Post subject: Reply with quote

The File Gadget CD device is used for virtual windows driver CD. Old phone has a dedicate FAT partition for internal storage, you can export and mount it as USB disk. Newer phone use an emulated folder for internal storage, the only way (USB) access it is via MTP or PTP protocol. Other methods is using TCP/IP networking, install and access it via FTP/sshd servers. You must connect both box to same wifi; or connect USB and enable USB hotspot (linux side require kernel RNDIS driver).
Back to top
View user's profile Send private message
Juippisi
Guru
Guru


Joined: 30 Sep 2005
Posts: 341
Location: /home

PostPosted: Sat May 06, 2017 5:31 am    Post subject: Reply with quote

I guess it depends on your phone, but for me, without file manager, simple-mtpfs was able to mount my phone so I could browse both internal storage and SD card.
Now I use Gnome-3 and I guess gvfs with "mtp" use flag does the trick, my phone gets mounted automatically and is browsable with Nautilus.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Sat May 06, 2017 7:17 am    Post subject: Reply with quote

As Juippisi said it is phone dependent. If you are using android https://wiki.gentoo.org/wiki/MTP might do the trick. If you feel like searching around Ubuntu generally has good documentation for this type of thing.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Sat May 06, 2017 8:48 am    Post subject: Reply with quote

An easy way to exchange files is to install a ftp-server app. Works fine for me, I connect phone via local wireless network :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43209
Location: 56N 3W

PostPosted: Sat May 06, 2017 9:47 am    Post subject: Reply with quote

as.gentoo.

Some phones are switchable between Media Transfer Protocol (MTP) and USB Storage.
Phones are moving away from USB Storage because of the complications of moving data off the phone.

Its generally not possible to mount USB Storage to your PC and phone at the same time. Very bad things happen
because the filesystem metadata is cached.
I suspect the phone has an option to unmount the (internal) USB Storage. When you do that. the PC should be able to mount it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3688
Location: Hamburg

PostPosted: Sat May 06, 2017 1:28 pm    Post subject: Reply with quote

simple-mtpfs seems here at a stable hardened Gentoo more reliable than a mtp:// under Dolphin (KDE5).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum