[KLUG Members] Re: drive ghosting -- RedHat "bootnet" disk,afio/cpio, etc...

Bryan J. Smith members@kalamazoolinux.org
Tue, 29 Jan 2002 11:39:41 -0500


Bruce Smith wrote:
> Not the stuff they put on roads, the Unix Tape ARchiver.  :-)

Unless your device has hardware compression (so you're just running
Tar with no software compression), Tar+Gz or Cpio+Gz (or any other
compression) is a _bad_move_ because the archive is compressed
_whole_.  While Tar itself has good recovery mechanisms, once
compressed, you are at the mercy of the compression algorithm's
recovery mechanisms.

Both Compress (LZH) and GZip (LZ77) have *NO* recovery mechanisms. 
This means that a single byte error will _destroy_ everything in
your compressed tarball (or compressed cpio archive as well) from
that point on.

BZip2 (BWT) uses some "blocking" algorithms that help localize
errors, but it still can leave much of the compressed
tarball/archive inaccessable from that error on.

What you want to use is an archiver that compressed per-file
_inside_ the archive.  So you don't remove the archiver's inherit
recovery logic.  That is where afio comes in.  It's cpio w/per-file
compression inside the archive.

> I don't.  (except for files on disk)

Oh, then that's good.

> I believe find|cpio & tar both are limited by the speed
> of my disks.

It all depends.  "Tar" adds overhead (both CPU and memory), whereas
"cpio -p" does not.  And unlike "cp -dpR" you preserve _all_
permissions, symlinks, device files, etc... with "cpio -pmd".

> "If you haven't found at least five ways to do the same
> thing In Unix, you haven't looked hard enough."

Right.  But experts agree, "find|cpio" is the fastest and most
reliable.

> I use tar because I'm more familiar with it, and it does
> the same job.

Then that's fine.

> I know people who use "cp -a" and claim it works fine too.
> (at least it's not "dump".  :)

No, it doesn't.  I haven't found a "cp" utility that handles
symlinks, device files and other details like tar or cpio.

-- Bryan

P.S.  I'm working on an utility called "cpmo" that does what tar,
cpio and mkisofs do independently, with per-file compression (Zlib,
Bz2lib and liblzo are standard compression libraries linked to it). 
It is also network aware and can use rcp (or scp) to stream output
to a remote system.

-- 
Bryan J. Smith, Engineer        mailto:b.j.smith@ieee.org   
AbsoluteValue Systems, Inc.     http://www.linux-wlan.org
SmithConcepts, Inc.          http://www.SmithConcepts.com
---------------------------------------------------------
1999 IRS Data:  The top 1% of income earners pay over 36%
of the taxes, but have less than 20% of the total income.