Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222116

Re: Re: unexpected behavior of cp and mv

From Alberto Sentieri <22t@tripolho.com>
Newsgroups linux.debian.user
Subject Re: Re: unexpected behavior of cp and mv
Date 2020-04-29 21:20 +0200
Message-ID <A10pr-4LB-5@gated-at.bofh.it> (permalink)
References <A0Yxk-3zD-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

When I tried strace with /bin/cp -pi I can see on both commands 
something like this:

utimensat(4, NULL, [{tv_sec=1588174263, tv_nsec=908624390} /* 
2020-04-29T11:31:03.908624390-0400 */, {tv_sec=1486350336, 
tv_nsec=481422339} /* 2017-02-05T22:05:36.481422339-0500 */], 0) = 0

The utimensat is exactly the same for both cp -pi to a ext4 file system 
or to a smb filesystem. So, cp seems to be working as expected. Probably 
the same is true to /bin/mv.

-----------------------------------------------------------------

Exactly the same behavior for /bin/cp and /bin/mv. I do not have any other cp or mv in my path.

$ sha1sum  /bin/cp /bin/mv
220687a082fb9d0dbb48e9a2b1093cbb4e9de55a  /bin/cp
46e71d67df7eb1c41f8f8c9039f401e242cce94a  /bin/mv


On Wed, Apr 29, 2020 at 12:22:41PM -0400, Alberto Sentieri wrote:
> cp and mv are not preserving the file timestamps when copying from a ext4
> file system to a smb file system.
> 
> I am running cp and mv on:
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID:    Debian
> Description:    Debian GNU/Linux 10 (buster)
> Release:    10
> Codename:    buster
> 
> SMB is running on:
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID:    Debian
> Description:    Debian GNU/Linux 9.12 (stretch)
> Release:    9.12
> Codename:    stretch
> 
> I am using "cp -pi" to copy the files and "mv -i" to move them.
> 
> If I run cp or mv on a Debian stretch, time stamps will be correct on the
> SMB file system.
> 
> Buster gnome3 file manager will copy or move the files without problems, I
> mean, they will preserve time stamps.
> 
> This started happening since I upgraded my workstation to buster, so the
> problem seems to be in buster. I am mounting the file system on buster with
> the following line added to fstab, which, by the way, is the same I was
> using when my workstation was running stretch:
> 
> //192.168.1.2/alberto /mnt/u1/rw cifs
> credentials=/root/pass/alberto.pass,uid=alberto,gid=alberto,rw 0 0
> 
> Does anyone knows which package is causing this behavior?
> 
First, do you see the same behavior if you use /bin/cp and /bin/mv
instead of simply cp and mv?

Regards,

-Roberto

-- 
Roberto C. Sánchez

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 19:10 +0200
  Re: unexpected behavior of cp and mv Roberto C. Sánchez <roberto@debian.org> - 2020-04-29 19:20 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 20:50 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 21:20 +0200
      Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 03:50 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:20 +0200
  Re: unexpected behavior of cp and mv Charles Curley <charlescurley@charlescurley.com> - 2020-04-29 21:20 +0200
    Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:10 +0200
      Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 22:20 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:30 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 23:00 +0200
          Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 23:30 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:40 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 12:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 16:20 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 18:50 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 19:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 20:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 21:50 +0200
                Re: unexpected behavior of cp and mv The Wanderer <wanderer@fastmail.fm> - 2020-04-30 22:00 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 22:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 23:40 +0200
              Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 20:00 +0200
          Re: unexpected behavior of cp and mv songbird <songbird@anthive.com> - 2020-04-30 00:00 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:10 +0200

csiph-web