When copying files from phone to PC using cp command to preserve original timestamp, it works without any issue. but doing it in reverse(PC to phone) causes an error. I ise my Pc as a backup of my phone and when i restore it, i dont want everything to be jumbled up. Here is the error log(username redacted). Distro- Manjaro XFCE
cp: preserving times for ‘/run/user/1000/gvfs/mtp:host=XiaomiSM6150-IDP_SN%3AE0C22BCD_d7cde9d/Internal shared storage/Pictures/photo.jpg’: Operation not supported
gvfs-mtp is used commonly in file managers on Linux. I guess there is a problem. I would rather say that cp does not support MTP, so non-linux filesystems. You can also try mtpfs:
I tried with mstfs also, unable to mount the device using that command. Here is the error log.
[[Redacted]@[Redacted]PC ~]$ mtpfs -o allow_other ~/Android
Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
Found 1 device(s):
Google Inc: Nexus/Pixel (MTP+ADB) (18d1:4ee2) @ bus 1, dev 2
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
[[Redacted]@[Redacted]PC ~]$ ls ~/Android
ls: cannot access '/home/[Redacted]/Android': Transport endpoint is not connected
[[Redacted]@[Redacted]PC ~]$
Thunar also reports same error (transport endpoint not connected) when opening home directory
I tried jmtpfs and go-mtpfs, both got mounted successfully and copying from the device preserves timestamps. Copying to the device however doesn’t preserves timestamps.
Jmtpfs returns error
failed to preserve ownership: function not implemented