GNU bug report logs - #52122
mv: deletes src file on error

Previous Next

Package: coreutils;

Reported by: Frank Busse <f.busse <at> imperial.ac.uk>

Date: Fri, 26 Nov 2021 11:10:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

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 52122 in the body.
You can then email your comments to 52122 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 bug-coreutils <at> gnu.org:
bug#52122; Package coreutils. (Fri, 26 Nov 2021 11:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Frank Busse <f.busse <at> imperial.ac.uk>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 26 Nov 2021 11:10:01 GMT) Full text and rfc822 format available.

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

From: Frank Busse <f.busse <at> imperial.ac.uk>
To: bug-coreutils <at> gnu.org
Subject: mv: deletes src file on error
Date: Fri, 26 Nov 2021 11:07:09 +0000
Hi,


Given two files: an old version of "foo" on a mounted USB stick:

/mnt/dst/foo

and a new version of "foo" in /src/foo on the system's hard drive. When
I do:

sudo mv /src/foo /mnt/dst/foo

I get the following error:

mv: failed to preserve ownership for '/mnt/dst/foo': Operation not permitted

The error is fine but mv deletes /src/foo and keeps mnt/dst/foo,
meaning that the data of the new file is lost. Is this the intended
behaviour? I'm using Coreutils 9.0.


Kind regards,

Frank




Information forwarded to bug-coreutils <at> gnu.org:
bug#52122; Package coreutils. (Fri, 26 Nov 2021 12:06:01 GMT) Full text and rfc822 format available.

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

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: Frank Busse <f.busse <at> imperial.ac.uk>, 52122 <at> debbugs.gnu.org
Subject: Re: bug#52122: mv: deletes src file on error
Date: Fri, 26 Nov 2021 12:05:21 +0000

On 26/11/2021 11:07 am, Frank Busse wrote:
> Hi,
> 
> 
> Given two files: an old version of "foo" on a mounted USB stick:
> 
> /mnt/dst/foo
> 
> and a new version of "foo" in /src/foo on the system's hard drive. When
> I do:
> 
> sudo mv /src/foo /mnt/dst/foo
> 
> I get the following error:
> 
> mv: failed to preserve ownership for '/mnt/dst/foo': Operation not permitted
> 

Is your USB stick (V)FAT(32) (or similar) formatted?


> The error is fine but mv deletes /src/foo and keeps mnt/dst/foo,
> meaning that the data of the new file is lost. Is this the intended
> behaviour? I'm using Coreutils 9.0.

Didn't reproduce this (as root).
mv (GNU coreutils) 8.32.179-c7577

> 
> 
> Kind regards,
> 
> Frank
> 
> 
> 
> 


-- 

Chris Elvidge





Information forwarded to bug-coreutils <at> gnu.org:
bug#52122; Package coreutils. (Fri, 26 Nov 2021 12:27:02 GMT) Full text and rfc822 format available.

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

From: Frank Busse <f.busse <at> imperial.ac.uk>
To: Chris Elvidge <celvidge001 <at> gmail.com>
Cc: 52122 <at> debbugs.gnu.org
Subject: Re: bug#52122: mv: deletes src file on error
Date: Fri, 26 Nov 2021 12:23:52 +0000
On Fri, 26 Nov 2021 12:05:21 +0000
Chris Elvidge <celvidge001 <at> gmail.com> wrote:

> Is your USB stick (V)FAT(32) (or similar) formatted?

It's FAT32.

> > The error is fine but mv deletes /src/foo and keeps mnt/dst/foo,
> > meaning that the data of the new file is lost. Is this the intended
> > behaviour? I'm using Coreutils 9.0.
> 
> Didn't reproduce this (as root).
> mv (GNU coreutils) 8.32.179-c7577

I tried it several times with checking the timestamps/md5sums of the
files but after remounting the stick it doesn't happen anymore?! I
guess it was a hiccup somewhere else in the system, sorry.


Kind regards,

Frank




Information forwarded to bug-coreutils <at> gnu.org:
bug#52122; Package coreutils. (Fri, 26 Nov 2021 17:56:02 GMT) Full text and rfc822 format available.

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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Frank Busse <f.busse <at> imperial.ac.uk>, Chris Elvidge <celvidge001 <at> gmail.com>
Cc: 52122 <at> debbugs.gnu.org
Subject: Re: bug#52122: mv: deletes src file on error
Date: Fri, 26 Nov 2021 18:54:54 +0100
On 11/26/21 13:23, Frank Busse wrote:
> I tried it several times with checking the timestamps/md5sums of the
> files but after remounting the stick it doesn't happen anymore?! I
> guess it was a hiccup somewhere else in the system, sorry.

Perhaps the USB stick was removed from the system before the kernel
could flush the data?

Have a nice day,
Berny




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 26 Nov 2021 18:19:01 GMT) Full text and rfc822 format available.

Notification sent to Frank Busse <f.busse <at> imperial.ac.uk>:
bug acknowledged by developer. (Fri, 26 Nov 2021 18:19:01 GMT) Full text and rfc822 format available.

Message #19 received at 52122-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Frank Busse <f.busse <at> imperial.ac.uk>, Chris Elvidge <celvidge001 <at> gmail.com>
Cc: 52122-done <at> debbugs.gnu.org
Subject: Re: bug#52122: mv: deletes src file on error
Date: Fri, 26 Nov 2021 10:18:44 -0800
On 11/26/21 04:23, Frank Busse wrote:
> I
> guess it was a hiccup somewhere else in the system, sorry.

Thanks for following up; closing the bug report.




Information forwarded to bug-coreutils <at> gnu.org:
bug#52122; Package coreutils. (Fri, 26 Nov 2021 19:02:02 GMT) Full text and rfc822 format available.

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

From: Frank Busse <f.busse <at> imperial.ac.uk>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Chris Elvidge <celvidge001 <at> gmail.com>, 52122 <at> debbugs.gnu.org
Subject: Re: bug#52122: mv: deletes src file on error
Date: Fri, 26 Nov 2021 18:59:22 +0000
On Fri, 26 Nov 2021 18:54:54 +0100
Bernhard Voelker <mail <at> bernhard-voelker.de> wrote:

> On 11/26/21 13:23, Frank Busse wrote:
> > I tried it several times with checking the timestamps/md5sums of the
> > files but after remounting the stick it doesn't happen anymore?! I
> > guess it was a hiccup somewhere else in the system, sorry.
> 
> Perhaps the USB stick was removed from the system before the kernel
> could flush the data?

No, I tried it several times with the stick still mounted. Strangely
enough, copying with a different name worked fine. Maybe a kernel or
hardware issue - no idea.


Best,

Frank




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

This bug report was last modified 2 years and 119 days ago.

Previous Next


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