Re: ** I/O performance for backup - tar , rsync , cp on FreeBSD **



David <david4731@xxxxxxxxxxx> writes:

On Jul 9, 1:26 pm, Bruno Flueckiger <inform...@xxxxxxx> wrote:
David wrote:
I recently tried to backup one drive to another on a live production
server with cp -Rp /path /path   and the copy took almost 11 hours.
My guess is this was due to hundreds of thousands of tiny small files
within this copy and that cp is a very inefficient way (due to I/O) to
do this backup.

I was wondering if rsync is just as efficient as tar in that it will
not require the I/O tasks that are being done with a full cp.

Thanks for your input!

My personal experience is that rsync is even less efficient than cp when
it has to perform full copies of files. rsync is efficient if you make
delta copies (that's what it is developed for). But I have to add that
I've observed this when using rsync to copy files via ethernet
connection to a NFS share. Under this setup cp is usual 2 - 3 times faster.

So what is the most efficient way to copy so many files from one drive
to another ? is there a way to tar it without needing twice the
space on the destination for an untar afterwards?

You can just put a pipeline in between the two tar invocations,
avoiding intermediate storage.

If the source is a whole filesystem (as I suspect it is from the
original description), then dump/restore is the strategy of choice.
You can also use a pipeline for this, feeding the standard output of
dump directly into the standard input of restore.

--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
.