help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about the "copy, then remove" behaviour of mv


From: Henrik Carlqvist
Subject: Re: question about the "copy, then remove" behaviour of mv
Date: Mon, 26 Oct 2009 20:31:41 +0100
User-agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)

Bob Proulx <bob@proulx.com> wrote:
> That tar command feels scary to me in the face of crashes.

Yes, you are right, files can be lost in the pipe before being flushed to
disk.

> The oringinal message brought up the problem of disconnecting a usb
> drive while in the middle of a copy.  In the case of using mv if the
> copy fails then the source will not be removed.  Reattaching the drive
> and then restarting the mv command is possible.

Yes, but disconnecting a mounted USB drive is never a good idea. You might
still lose some files not flushed to the disc but residing in the cache
handled by the OS. Even files written might be lost because of file system
crashes.  Even some journaling file systems might lose file contents at
these circumstanses, with only metadata journaled you might only be
guaranteed that the file system itself will not be broken.

Maybe the OP ought to fix the problem with a USB disk being disconnected
during file transfers instead of fixing the way how files are transfered.

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost



reply via email to

[Prev in Thread] Current Thread [Next in Thread]