2

Nexus 5 with stock Android 4.4.4

Ubuntu Desktop 14.04 LTS

If I plug my phone into my computer, it's automatically detected and mounted. Using nautilus I can navigate to my DCIM/Camera folder and copy the photos to my desktop.

I wanted to automate this process, and so I wrote a script that runs after the phone has been mounted. It automatically detects the mount point (usually something like /run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C004%5D/), retrieves a list of the photos and copies them to my desktop using cp.

I took me a long time to notice, but command line tools (like cp and md5sum) do not see the last 32 bytes of the files. When I copy the files to my desktop, the final 32 byes of all files are missing. If I take an md5sum hash of the files, the hash returned is for a file that is missing those same 32 bytes.

I've googled a bit, and can't find anyone with a similar problem.

1

I have a simple way, Try connect your phone with PTP and Shotwell Photo Manager has auto copy picture and videos to your computer. There are more photo management in Linux, just Google it.

It's how to connect Nexus 5 with PTP:

  1. Connect phone to Computer
  2. Open notification bar.
  3. Tap to "Connected as a media device".
  4. Select Camera (PTP) instead (MTP).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.