1753473 Members
4426 Online
108794 Solutions
New Discussion юеВ

tar vs cpio

 
SOLVED
Go to solution
magnus linner
Advisor

tar vs cpio

All,
I am about to upgrade Ignite and saw that ignite now also support cpio for make_net_recovery and make_tape_recovery.
Have anyone tried using any of those tools with cpio?
Which one is faster, take less space and is most stable?
Thanks
7 REPLIES 7
Jeff Schussele
Honored Contributor

Re: tar vs cpio

Hi Magnus,

As far as I know, by default, make_tape_recovery uses pax to archive files. And that's as it should be as it can handle either tar or cpio formats.
I never override the defaults so I can't speak to the issue of which is faster.
But one thing to consider is largefiles - tar/cpio cannot handle them - pax can.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ricardo Bassoi
Regular Advisor

Re: tar vs cpio

Hi !

From the man pages:

The new ASCII format is portable between different machine architectures and can be used on any size file system, but is not supported by all versions of cpio; currently, it is only supported by GNU and Unix System V R4. The crc format is like the new ASCII format, but also contains a checksum for each file which cpio calculates when creating an archive and verifies when the file is extracted from the archive. The HPUX formats are provided for compatibility with HPUX's cpio which stores device files differently.

The tar format is provided for compatability with the tar program. It can not be
used to archive files with names longer than 100 characters, and can not be used to archive "special" (block or character devices) files. The POSIX.1 tar format can not be used to archive files with names longer than 255 characters (less unless they have a "/" in just the right place).

By default, cpio creates binary format archives, for compatibility with older cpio
programs.When extracting from archives, cpio automatically recognizes which kind of archive it is reading and can read archives created on machines with a different
byte-order.

Some of the options to cpio apply only to certain operating modes; see the SYNOPSIS section for a list of which options are allowed in which modes.

Conclusion: Use cpio !
If you never try, never will work
Patrick Wallek
Honored Contributor
Solution

Re: tar vs cpio

Yes, the new version of Ignite/UX allow you to specify a command line option '-m tar|cpio' to choose whether pax writes the tape in tar format or cpio format.

I did a test on an A500 a few weeks ago using both '-m tar' and '-m cpio' to write the tape. The '-m tar' was actually faster. I doubt that either will take any more or less space than the other. I personally plan on sticking with tar. To me it is easier to get a single file off of the tape with tar than it is with cpio.

Here are the results of my test pasted from an e-mail I sent out to somone else:

There is approximately 2.3GB of data in VG00 on this machine. When I did the make_tape_recovery with the '-m tar' option it took 29 minutes 14 seconds. When I used '-m cpio' it took 33 minutes 43 seconds. From this test at least, if speed is important to you, go with tar to write the tape.
Brian M Rawlings
Honored Contributor

Re: tar vs cpio

Excellent post, Patrick! It appears that the reason for the cpio option is for portability, to allow the data to be recovered on other types of unix. For the vast majority of ignite tape use, that simply doesn't apply.

For me, I need a real reason to go with anything other than the defaults on stuff like this. Sticking with the defaults means that other people who I work with or who may come after me can just act normally, with results as expected. Documentation is reduced, assumptions are generally valid, and life is good.

Based on this philosophy, and on Patrick's time testing, I see no advantage to using the cpio option.

One man's opinion... --bmr
We must indeed all hang together, or, most assuredly, we shall all hang separately. (Benjamin Franklin)
Steven E. Protter
Exalted Contributor

Re: tar vs cpio

Advice.

Run ignite in a standard way, ie with tar.

Thats how they do it in training.

pax still has the 2G limit on files even though they've managed to bump that up to 8G in tar(see back posts).

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: tar vs cpio

By the way, the command I used to do the test was:

# /opt/ignite/bin/make_tape_recovery -a /dev/rmt/0mn -I -m tar -v -x inc_entire=vg00

For the cpio test, I just changed the '-m' option to '-m cpio' and left everything else the same.
Bill Hassell
Honored Contributor

Re: tar vs cpio

tar and cpio and pax all have the same limitations: 2Gb files are the maximum that can be saved. The industry standard defines the width and content of each file header and there simply isn't enough room for larger files There are new versions of GNUtar that can handle this but to read the tape requires the same versionn of GNUtar.

cpio has a maximum blocksize of 5k while tar has a blocksize of 10k, implying that better tape utilization is possible with tar. vg00 should not have largefiles as vg00 is the opsystem. Unfortunately, larger disks (18 Gb and 36 Gb) have created situations where everything can be contained on a single disk (performance penalty) and this may include largefiles, thus rendering Ignite/UX less useful for vg00 backups.


Bill Hassell, sysadmin