Can not copy files by cp from Samsung S5 Mini in GVFS in MTP mode

Bug #1389001 reported by Jarno Suni
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gvfs (Ubuntu)
Invalid
Undecided
Philip Langdale

Bug Description

In terminal:
jarnos@jarnos-OptiPlex-745:/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C013%5D/Card/DCIM/Camera$ ls -l 20141103_114415.jpg ; cp 20141103_114415.jpg ~/Desktop/
-rw------- 1 jarnos jarnos 1205994 marra 3 11:44 20141103_114415.jpg
cp: cannot open ‘20141103_114415.jpg’ for reading: Operation not supported

But I can browse to the folder by Thunar or PCManFM and copy paste a file to ~/Desktop/. On the other hand I can not open the files even via those file managers.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: coreutils 8.21-1ubuntu5
ProcVersionSignature: Ubuntu 3.13.0-39.66-lowlatency 3.13.11.8
Uname: Linux 3.13.0-39-lowlatency x86_64
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue Nov 4 00:19:11 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-09-21 (43 days ago)
InstallationMedia: Ubuntu-Studio 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.1)
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jarno Suni (jarnos) wrote :
Revision history for this message
Philip Langdale (langdalepl) wrote :

This is due to the limitations in non-Google mtp stacks. You cannot do direct file access, which makes it impossible to do low level file copies like this. The file managers use the gvfs api that allows file copies. From the command line you can use the gvfs-copy utility.

You could also install cyanogenmod on the phone to get the Google mtp stack.

affects: coreutils (Ubuntu) → gvfs (Ubuntu)
Changed in gvfs (Ubuntu):
assignee: nobody → Philip Langdale (langdalepl)
status: New → Invalid
Revision history for this message
Jarno Suni (jarnos) wrote :

My phone is not in the list of supported devices. It is a shame gvfs-copy does not have --update option. And what is the equivalent for rsync?

Revision history for this message
Philip Langdale (langdalepl) wrote :

That's unfortunate. Basically, without those google extensions, MTP can only do full-file copies. It can read a file off the device or send a file. It can't let you read a little bit of a file, or selectively update part of a file. This makes it mechancially impossible to do any incremental operations, as you'd need for rsync. It means you can't copy files with non-gvfs applications, and you can't open files in applications. You have to copy the files to your computer (using Nautilus, Thunar, etc), do whatever you want to them, and then copy them back (or delete them if you were just reading them). It's a miserable experience, but it's all that MTP has to offer.

The google extensions allow for normal random I/O on files, which makes life much easier - but Samsung insist on using their own MTP server instead of the standard Android one.

Revision history for this message
Jarno Suni (jarnos) wrote :

I wouldn't need partial copying, but I wish gvfs-copy could preserve modification time and copy only files that are not already in the destination. (Something like cp --update --recursive --preserve=timestamps ) Or at least copy only files that are not (by same name) in the destination.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.