Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: File dates lost when transferring files from phone using Nautilus (mtp, usb)

  1. #1
    Join Date
    Nov 2013
    Beans
    6

    File dates lost when transferring files from phone using Nautilus (mtp, usb)

    UPDATE 2 October 2015: GREAT NEWS! THIS BUG HAS FINALLY BEEN FIXED in time for UBUNTU 15.10.
    The gvfs package has been updated and contains a fix! Timestamps are now preserved.
    See: https://bugs.launchpad.net/ubuntu/+s...s/+bug/1175947

    PROBLEM: file dates are lost when I copy files from my phone to my laptop using a usb cable..

    DETAILS:
    I wish to transfer files (photos etc.) from my Samsung S4 phone to my Ubuntu 13.10 laptop (upgraded from Ubuntu 13.04).

    If I plug in the usb cable, the phone is automatically detected as an mtp device (mtp://[usb:002,009]/) and I can browse the files on my phone using the file browser Nautilus. I can also see the correct file dates in Nautilus (for files located in the phone).

    I am able to copy files to my laptop hard drive (using drag and drop or ctlr-cv), but all the original file dates are lost.

    The original file dates are replaced with the current time of transfer.
    i.e. the dates on the files copied to my hard drive are the time of transfer.

    I consider this to be a serious bug, as file dates should be preserved.

    Is there a fix or work-around for this problem?

    Is this just my Samsung S4 phone or are others experiencing the same problem?

    UPDATE: I have now checked the problem with a live CD distro of Ubuntu 13.10, and with Ubuntu 13.04, and the problem is still present.
    I also tested with a Samsung S2 phone, and the problem is the same.
    I have also tested file transfer on a Windows 7 PC, and the problem is not present (i.e. With Windows, the file dates are preserved), and so I conclude that the problem is with Ubuntu.

    On Ubuntu's Nautilus file browser,

    If I right-click properties on the copied file, it shows two dates. "Accessed" and "Modified". Both are set to the time of file copying.
    If I right-click properties on the source file (stored in the phone), "Accessed: unknown" and "Modified" is the date of when the file was created.

    I have placed a high res screenshot here:
    https://dl.dropboxusercontent.com/u/...%3A59%3A18.png

    The screen shot shows the contents of the phone on the right side and the properties of IMG_0786.jpg. On the left side is shown the copied file and its properties. Clearly the dates are different.
    Last edited by ajw-free; October 2nd, 2015 at 06:53 PM. Reason: Added link to screenshot.

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    If you copy ctrl-c and paste ctrl-v the files from one Nautilus window to another, the original dates and times should be preserved.

  3. #3
    Join Date
    Nov 2013
    Beans
    6

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    Quote Originally Posted by Lars Noodén View Post
    If you copy ctrl-c and paste ctrl-v the files from one Nautilus window to another, the original dates and times should be preserved.
    I tried using the ctrl-c ctrl-v method but the result is the same as when I use drag and drop.

    i.e. the dates on the files that I copy to my hard drive from my phone are not preserved.

    The file date (time-stamp) is changed to the current time at which the copy action takes place.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    Strange. I'm using Nautilus and both ctrl-c/ctrl-v and drag-and-drop preserve the file dates on the files I have tried. What type of filesystem is your phone getting mounted as? That might be it. What about other methods does it preserve the dates if you transfer with rsync?

  5. #5
    Join Date
    Jul 2007
    Location
    UK
    Beans
    17,059
    Distro
    Ubuntu Development Release

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    I thought the modified date wss preserved. Check in file properties. However cp command has a preserve flag.

    http://askubuntu.com/questions/22603...pying-to-a-nas

  6. #6
    Join Date
    Nov 2013
    Beans
    6

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    When I plug in my Galaxy S4 phone via a USB cable, it automatically mounts and appears in Nautilus as an "mtp" type device.

    I have edited my original post above to include some more information.
    I have included a link to a screenshot which clearly shows the file date problem - please take a look.
    I have placed a high res screenshot here:
    https://dl.dropboxusercontent.com/u/...%3A59%3A18.png

    I have also tested a Galaxy S2 phone, and it gives the same problem (i.e. file dates lost on transfer from phone to PC).
    I also tried the same with Windows 7, and the problem is not present (i.e. file dates are preserved). I conclude that the problem is in Ubuntu.

  7. #7
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    You can check which filesystem is being used by your phone with df.

    Code:
    df -h | grep "^/dev/"
    What does it say?

  8. #8
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    @ajw-free, I cannot reproduce your problem when I plug my Samsung Galaxy Ace GT-S5830 phone into my Ubuntu 13.10 system. Drag and drop copy from the phone to a folder in my home using Nautilus preserves the modified date and time.

    However, with my Samsung Galaxy tablet, I do see what you see - modified date is changed to current when copied.

    I agree with you - changing the date/time is not just a bug, it's data corruption. I'll do some more digging around to try to discover why I'm seeing this with one Android device and not another.

    EDIT: Oops - it was obvious really. It seems my phone is being mounted in PTP mode, and my tablet in MTP. MTP capability is fairly new in Linux. It sounds as though it needs more work.
    Last edited by coffeecat; November 13th, 2013 at 12:27 PM.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  9. #9
    Join Date
    Nov 2013
    Beans
    6

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    df -h | grep "^/dev/"
    /dev/sda7 39G 5,9G 31G 17% /
    /dev/sda5 775G 185G 551G 26% /home


    The phone does not appear as a device on this list.
    It has something to do with the fact that it is an mtp device (I am not a specialist in this).

    According to this posting http://askubuntu.com/questions/34231...the-filesystem

    the mountpoints are in /run/user/$USER/gvfs/

    I can see can my phones's presence via
    ls -als /run/user/1000/gvfs/mtp\:host\=%5Busb%3A002%2C008%5D/Phone/

    e.g.
    ls -als /run/user/1000/gvfs/mtp\:host\=%5Busb%3A002%2C009%5D/Phone/DCIM/WIFISD/
    total 10538
    0 drwx------ 1 user user 0 Nov 3 22:52 .
    0 drwx------ 1 user user 0 Nov 9 16:45 ..
    5593 -rw------- 1 user user 5726647 Nov 3 22:52 IMG_0786.JPG
    4946 -rw------- 1 user user 5063709 Nov 3 22:52 IMG_0787.JPG


    Unfortunately any attempt to copy files using command line cp gives an error message.

    e.g.
    cp -p /run/user/1000/gvfs/mtp\:host\=%5Busb%3A002%2C009%5D/Phone/DCIM/WIFISD/IMG_0786.JPG .
    cp: cannot open ‘/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C009%5D/Phone/DCIM/WIFISD/IMG_0786.JPG’ for reading: Operation not supported

    Only Nautilus copy operations appear to copy the files, but do not preserve the original dates.
    The strange thing is that one can actually see the orignal dates via Nautilus in the phone's memory (see my screenshot).
    Somehow, they are not preserved in the file transfer.

    This needs attention from a developer. It must be fixed asap.

  10. #10
    Join Date
    Nov 2013
    Beans
    6

    Re: File dates lost when transferring files from phone using Nautilus (mtp, usb)

    Quote Originally Posted by coffeecat View Post
    @ajw-free, I cannot reproduce your problem when I plug my Samsung Galaxy Ace GT-S5830 phone into my Ubuntu 13.10 system. Drag and drop copy from the phone to a folder in my home using Nautilus preserves the modified date and time.

    However, with my Samsung Galaxy tablet, I do see what you see - modified date is changed to current when copied.

    I agree with you - changing the date/time is not just a bug, it's data corruption. I'll do some more digging around to try to discover why I'm seeing this with one Android device and not another.

    EDIT: Oops - it was obvious really. It seems my phone is being mounted in PTP mode, and my tablet in MTP. MTP capability is fairly new in Linux. It sounds as though it needs more work.
    @coffeecat. I'm glad that someone else is able to reproduce the problem.

    Yes- it is data corruption, and needs to be fixed by a developer asap.
    I'm not sure how/where to report it?

    The problem is definitely related to MTP. This bug was present in Ubuntu 13.04 too.

    Android smart phones are now widely used and the usb transfer protocol is changing to MTP (as opposed to "usb storage"). Data transfers need to be reliable. It is surprising to me that this bug was not fixed shortly after 13.04 was released.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •