GNU bug report logs - #7612
cp -pu NTFS problem

Previous Next

Package: coreutils;

Reported by: Garry Trethewey <garrytre <at> bigpond.com>

Date: Sat, 11 Dec 2010 00:25:02 UTC

Severity: normal

Merged with 7613

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7612 in the body.
You can then email your comments to 7612 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7612; Package coreutils. (Sat, 11 Dec 2010 00:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Garry Trethewey <garrytre <at> bigpond.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 11 Dec 2010 00:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Garry Trethewey <garrytre <at> bigpond.com>
To: ntfs-3g-devel <at> lists.sf.net, bug-coreutils <at> gnu.org
Subject: cp -pu NTFS problem
Date: Sat, 11 Dec 2010 10:59:38 +1030
[Message part 1 (text/plain, inline)]
Hello

The attachment has this same text but might be easier to read than an email.


I don't know if this is a NTFS-3g bug, or a coreutils cp bug, or 
neither, or both.


I've asked the <linuxsa <at> linuxsa.org.au> list, which hasn't been able to 
help apart from confirming that someone else has the same problem.


Problem
Trying to cp -pu  from an NTFS partition to an ext3 partition, the 
timestamps look OK, both with terminal ls -l and in nautilus (Date 
Modified and Date Accessed).

The -u option says that the same file should not get copied again unless 
it's changed.

But it does get copied again, and again



Just to remind,
-p     same as --preserve=mode,ownership,timestamps
-u, --update copy only when the SOURCE file is newer than the
destination file or when the destination file is missing


So here's the longer version with too many details.

For a couple of years I've been doing
cp -puv -t $dest $source
from one ext3 partition to another, no problem.

But now I've copied my whole data disk to an NTFS partition on a USB
portable hard drive. NTFS so I can use it at work.

I want to copy files from this NTFS partition to an ext3 destination
with timestamps intact, so that next week when I do the same thing, I
only copy new or changed files.

Demo* code is
source=/media/data/aaa_S500_data/*    # the NTFS partition
dest='/home/garry/Desktop/junk'       # a ext3 partition
cp -puv -t $dest $source
Demo*   Really I look at 30GB and 20,000 files, that's why I don't want 
to be copying the same thing repeatedly.

Here is a demo source directory
garry <at> S500-lucid:~$ ls -l /media/data/aaa_S500_data/
total 64
-rwxrwxrwx 1 garry garry 38254 2010-12-02 06:20 elephantGreen.ico
-rwxrwxrwx 1 garry garry  5978 2010-10-25 17:27 elephant.ico
-rwxrwxrwx 1 garry garry    69 2010-11-30 05:55 readme.txt
-rwxrwxrwx 1 garry garry   766 2002-10-14 04:27 wdlogo.ico
-rwxrwxrwx 1 garry garry  5978 2010-10-25 17:27 wooly-mammoth.ico
garry <at> S500-lucid:~$


So into an empty directory, '/home/garry/Desktop/junk'  I copy
garry <at> S500-lucid:~$ cp -puv  -t '/home/garry/Desktop/junk'
/media/data/aaa_S500_data/*
`/media/data/aaa_S500_data/elephantGreen.ico' -> 
`/home/garry/Desktop/junk/elephantGreen.ico'
`/media/data/aaa_S500_data/elephant.ico' -> 
`/home/garry/Desktop/junk/elephant.ico'
`/media/data/aaa_S500_data/readme.txt' -> 
`/home/garry/Desktop/junk/readme.txt'
`/media/data/aaa_S500_data/wdlogo.ico' -> 
`/home/garry/Desktop/junk/wdlogo.ico'
`/media/data/aaa_S500_data/wooly-mammoth.ico' -> 
`/home/garry/Desktop/junk/wooly-mammoth.ico'
garry <at> S500-lucid:~$

Then without changing any files in $source, and if I do
cp -puv  -t '/home/garry/Desktop/junk' /media/data/aaa_S500_data/*
again, nothing should be copied.

But the two files that were created / altered on the NTFS partition
_AFTER_ it got created with gparted & partimage get copied again.

garry <at> S500-lucid:~$ cp -puv  -t '/home/garry/Desktop/junk' 
/media/data/aaa_S500_data/*
`/media/data/aaa_S500_data/elephantGreen.ico' -> 
`/home/garry/Desktop/junk/elephantGreen.ico'
`/media/data/aaa_S500_data/readme.txt' -> 
`/home/garry/Desktop/junk/readme.txt'
garry <at> S500-lucid:~$

and again

garry <at> S500-lucid:~$ cp -puv -t $dest $source
`/media/data/aaa_S500_data/elephantGreen.ico' -> 
`/home/garry/Desktop/junk/elephantGreen.ico'
`/media/data/aaa_S500_data/readme.txt' -> 
`/home/garry/Desktop/junk/readme.txt'



here is my /etc/fstab
proc            /proc           proc    nodev,noexec,nosuid 0       0
UUID=a49e1eb6-72bc-465d-9852-ce99403d303f /               ext3 
errors=remount-ro 0       1
UUID=f13a83d6-fdfd-4dc7-b67c-a3d47c9fd727 none            swap    sw 
       0       0
UUID=07B3B28C580F4BEA /media/data     ntfs-3g 
defaults,umask=000,uid=1000,gid=1000 0       1
#UUID=07B3B28C580F4BEA /media/data     ntfs-3g 
defaults,relatime,umask=000,uid=1000,gid=1000 0       1
#UUID=07B3B28C580F4BEA /media/data     ntfs    defaults  0       1
UUID=c1841d07-7991-4e9c-8d35-969cb49ccf28  /media/toybox_data  ext3 
defaults   0   2


I tried
touch --reference '/media/data/aaa_S500_data/newfile' 
'/home/garry/Desktop/junk/newfile'
but that made no difference.


What I'm using:-
ubuntu 10.04
ntfs-3g 2010.3.6       	#came with ubuntu
ntfs-3g 2010.10.2	#installed today
GNU Bash-4.1
cp in GNU coreutils 7.4


So is this a proper bug that I should put on launchpad? Looks like it to 
me, but I'm amazed if nobody else found it first.


regards

------------------------------------
Garry Trethewey
------------------------------------
[prettier.txt (text/plain, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7612; Package coreutils. (Sat, 11 Dec 2010 05:15:03 GMT) Full text and rfc822 format available.

Message #8 received at 7612 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Garry Trethewey <garrytre <at> bigpond.com>
Cc: 7612 <at> debbugs.gnu.org, ntfs-3g-devel <at> lists.sf.net
Subject: Re: bug#7612: cp -pu NTFS problem
Date: Fri, 10 Dec 2010 21:20:57 -0800
That looks like bug 7529 (aka bug 605639).
Please try this patch:

http://lists.gnu.org/archive/html/bug-coreutils/2010-12/msg00012.html




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7612; Package coreutils. (Sat, 11 Dec 2010 05:37:01 GMT) Full text and rfc822 format available.

Message #11 received at 7612 <at> debbugs.gnu.org (full text, mbox):

From: Garry Trethewey <garrytre <at> bigpond.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 7612 <at> debbugs.gnu.org, ntfs-3g-devel <at> lists.sf.net
Subject: Re: bug#7612: cp -pu NTFS problem
Date: Sat, 11 Dec 2010 16:11:58 +1030

On 11/12/10 15:50, Paul Eggert wrote:
> That looks like bug 7529 (aka bug 605639).
> Please try this patch:
>
> http://lists.gnu.org/archive/html/bug-coreutils/2010-12/msg00012.html
>

Thanks

1) I can see the difference
-                for (a /= res; a % 10 != 0; a /= 10)
+                for (a /= res; a % 10 == 0; a /= 10)
but I'm just not that clever to apply a patch.

2) I touch'ed a dest file so it's got tomorrow's date, and cp -p still 
copies to it, although not updating  (downdating?) it's timestamp.

3) I also put the story on  http://tuxera.com/forum/  as 
szaka <at> tuxera.com asked, so I spose ntfs-3g-devel <at> lists.sf.net is not now 
the place to look.

Must admit I haven't done all this before, so I don't want to put 
something stupid all over the world.

regards
------------------------------------
Garry Trethewey
------------------------------------






Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7612; Package coreutils. (Sat, 11 Dec 2010 07:54:02 GMT) Full text and rfc822 format available.

Message #14 received at 7612 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Garry Trethewey <garrytre <at> bigpond.com>
Cc: 7612 <at> debbugs.gnu.org, ntfs-3g-devel <at> lists.sf.net
Subject: Re: bug#7612: cp -pu NTFS problem
Date: Fri, 10 Dec 2010 23:59:45 -0800
On 12/10/2010 09:41 PM, Garry Trethewey wrote:

> 1) I can see the difference
> -                for (a /= res; a % 10 != 0; a /= 10)
> +                for (a /= res; a % 10 == 0; a /= 10)
> but I'm just not that clever to apply a patch.

If you've built the software, then
find the line that looks like the "-" line, and change it
so that it looks like a "+" line.  Then type "make".
(If all this is beyond you, then don't worry too much; the bug
will be fixed in the next version of coreutils.)

> 2) I touch'ed a dest file so it's got tomorrow's date,
> and cp -p still copies to it, although not updating  (downdating?) it's timestamp.

That sounds very much like a bug, perhaps a different bug, though I'm
afraid I can't reproduce it since I don't have your system.




Information forwarded to bug-coreutils <at> gnu.org:
bug#7612; Package coreutils. (Sun, 13 Nov 2011 12:03:01 GMT) Full text and rfc822 format available.

Message #17 received at 7612 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 7612 <at> debbugs.gnu.org, Garry Trethewey <garrytre <at> bigpond.com>,
	ntfs-3g-devel <at> lists.sf.net
Subject: Re: bug#7612: cp -pu NTFS problem
Date: Sun, 13 Nov 2011 13:02:25 +0100
forcemerge 7612 7613
close 7612
thanks

Paul Eggert wrote:
> On 12/10/2010 09:41 PM, Garry Trethewey wrote:
>
>> 1) I can see the difference
>> -                for (a /= res; a % 10 != 0; a /= 10)
>> +                for (a /= res; a % 10 == 0; a /= 10)
>> but I'm just not that clever to apply a patch.
>
> If you've built the software, then
> find the line that looks like the "-" line, and change it
> so that it looks like a "+" line.  Then type "make".
> (If all this is beyond you, then don't worry too much; the bug
> will be fixed in the next version of coreutils.)

This was resolved last year, so closing.




Forcibly Merged 7612 7613. Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 13 Nov 2011 12:03:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 7612 <at> debbugs.gnu.org and Garry Trethewey <garrytre <at> bigpond.com> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 13 Nov 2011 12:03:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 11 Dec 2011 12:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.