On Sat, 4 Apr 2009, Tony Abernethy wrote:

> Any differences in efficiency between cp and mv 
> with be swamped by any time taken thinking about it.

Huh?  the difference in efficiency isn't the issue, the issue is the
state of the disc directory "/".

cp /bsd.foo /bsd

Suppose the / fs is the old, standard ffs and is mounted async.

It may be "some time" before the file buffers are flushed (synced).
A crash during that interval can result in a corrupted /bsd.  This,
I think is the old bugaboo.  

mv will be a call to "rename(2)", and in most sane implementations
of ffs, the resulting changed directory entry (i.e. the changed inode)
will be flushed to disk immediately.

There was a time when disk writes were much slower than now.  

Still, we should consider the time taken by cp to be "long", and
since I believe that cp is "interruptable", cp may be paged out for
higher priority activities.  This being the case, we cannot guarantee
that cp will complete in certain time, or if it will complete at
all.  Cp makes many system calls, and can be interrupted or even
swapped out.  This is a distinct possiblilty on a busy machine or
one that is "swapping".  OpenBSD is not magic -- and its behavior
when swapping is actually miserable.  (1GHz dual Pentium III:
five-ten second delays refreshing the screen with mozilla when that
bloated, memory-leaking, crash-prone pig has consumed 400 MB of
core and is eating into swap -- this even when X itself is offloaded
to an X-terminal).

so anything with /bsd as the destination of a cp(3) is "dangerous".

Dave
_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to