0

I use a RedMi 3S (Android 6.0.1), non-rooted and fully updated.

I have a large number of photographs in my DCIM/Camera folder (in my "Internal Storage"). They're visible via the Gallery app, File Manager, and even visible and accessible via an SFTP server that I set up on the phone.

However, if I connect the phone to a PC with a USB cable, and choose either PTP or MTP (Files or Photos respectively) - I don't see these photos. I do see the DCIM/ folder, and one of the other subfolders there (named Screenshot) but DCIM/Camera is suspiciously missing.

Why is this happening and how can I transfer my photos over USB?

Notes:

  • Unlike the highly related question, the issue here is not the out-of-date media manager database; I just performed a "rescan", and it didn't change anything.
Robert
  • 20,025
  • 6
  • 47
  • 66
einpoklum
  • 533
  • 2
  • 7
  • 30
  • MTP always sucks. If you have root, use UMS for extreme data transfer speed for larger data. Or use adb pull/push. – Irfan Latif Nov 06 '18 at 10:32
  • @IrfanLatif: And seeing how I've not rooted the phone?... – einpoklum Nov 06 '18 at 10:42
  • adb pull isn't a bad option – Irfan Latif Nov 06 '18 at 10:45
  • @IrfanLatif: What would be the command I need to type? I have adb installed on Linux. – einpoklum Nov 06 '18 at 10:56
  • Enable USB debugging on phone from Developer Options. Connect phone to PC and pass key pairing, then execute: 'mkdir Camera; cd Camera; adb pull /sdcard/DCIM/Camera'. Whole Camera folder will be copied to PC. However adb doesn't allow listing the contents of a folder (like ls or dir command does). MTP let it be done through File Explorers on Windows and many Linux distros. – Irfan Latif Nov 06 '18 at 13:08
  • MTP client makes different requests (https://en.wikipedia.org/wiki/Media_Transfer_Protocol#Direct_modification_and_partial_transfer_features) to "MTP Host" app on Android which works through a files database (MediaStore) built by "Media Storage" app (/data/data/com.android.providers.media/databases/external.db). If this database isn't updated as the files change, you need to force its updation. Delete this file and run some media scanner app from Play Store (restarting phone may not update whole database though MediaScannerReceiver broadcast receiver is launched on boot). – Irfan Latif Nov 06 '18 at 13:08
  • Non-root users can delete this file by clearing data of "Media Storage" app. But be cautious. It'll also clear internal.db which will make ringtones etc. unavailable. Once the database is updated, MTP will show all contents of internal SD Card on PC. – Irfan Latif Nov 06 '18 at 13:08
  • Other options include transferring data through network, while connecting to Wi-Fi. SSH (SFTP, SCP, SSHFS) NFS, CIFS, FTP are all client-server protocols that can be used for the purpose. NFS, CIFS and SSHFS also allow mounting of the shared directories so that contents can be listed, copied, moved, renamed and deleted using GUI File Explorers easily. However data transfer speed over Wi-Fi is slower than USB cable, depending on multiple factors. But after all, you can't compete UMS when it comes to speed and reliability. – Irfan Latif Nov 06 '18 at 13:15
  • 3
  • @einpoklum if your computer has support for Wi-Fi, you can use KDEConnect app (install its counterpart in Linux; works on non-KDE desktops too -- requires some dependencies) from Play Store in your device. Works fine and quite about every time. I use it to get notifications from the device and I can access my device through it on Linux. Otherwise, you can read https://android.stackexchange.com/q/91900/96277 – Firelord Nov 07 '18 at 08:21
  • @Robert: See edit – einpoklum Nov 07 '18 at 09:43
  • Try connecting your phone in unlocked state. – Albin K C Nov 07 '18 at 18:47

1 Answers1

1

As you point out you're using Linux, I strongly recommend taking a look at adbfs. You can use that to mount the entire device to your computer and access it as if it were local. I'm using it for years and am very satisfied with it (including the support).

  1. download/clone the repo
  2. follow the install instructions (on the linked page)
  3. create yourself a "mount point" (where you want to see the Android device, e.g. /home/foobar/droid)
  4. attach your device (USB debugging enabled) via USB
  5. verify with adb devices that it's there
  6. mount it: adbfs /home/foobar/droid
  7. access everything the non-root user has access to – including the photos – read/write
  8. when done, unmount: fusermount -u /home/foobar/droid

(of course, once it's working you'll only need to repeat steps 5/6 to 8)

When mounted, it's available like any local file system – so you can access it from the shell, or use a graphical file explorer, or access it with whatever programs you want. As Irfan pointed out: MTP sucks (isn't it a MS product?) – but adbfs never let me down.

Izzy
  • 91,166
  • 73
  • 343
  • 943