# How do I access a smartfones internal storage?

## as.gentoo

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

```
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

```
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 

```
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 

```
Direct-Access     ABC      Android Phone
```

 at the same place, so that just seems to be a name coming from the phone…   :Rolling Eyes: 

Do you know an other way?

Thanks in advance!

----------

## s4e8

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).

----------

## Juippisi

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.

----------

## The Doctor

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.

----------

## Irre

An easy way to exchange files is to install a ftp-server app. Works fine for me, I connect phone via local wireless network  :Smile: 

----------

## NeddySeagoon

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.

----------

## toralf

simple-mtpfs seems here at a stable hardened Gentoo more reliable than a mtp:// under Dolphin (KDE5).

----------

