1753338 Members
5429 Online
108792 Solutions
New Discussion юеВ

tar VS cpio

 
SOLVED
Go to solution
Sundar_7
Honored Contributor

tar VS cpio


God ! I am bugged up with this question..

**What is the difference between tar and cpio**

Is it that cpio can copy a entire file system to a different file system ..that tar cannot do ..

Anyone with answeres please

Thanks

Sundar

Learn What to do ,How to do and more importantly When to do ?
8 REPLIES 8
Robin Wakefield
Honored Contributor

Re: tar VS cpio

Hi Sundar,

How about:

tar...:
... has relatively simple syntax.
... allows you to replace archived files with different versions and append new files to the end of an archive without having to rewrite the file from the beginning.

cpio...:

... can back up files describing devices (special files), as well as data files.
... writes data in a stream format, saving space and time when creating a tape backup; cpio tends to be faster than tar and stores data more efficiently than tar.
..., unlike tar, will attempt to read a tape several times if it encounters problems.
... will skip a bad area on tape.

Rgds, Robin
harry d brown jr
Honored Contributor
Solution

Re: tar VS cpio

Take a look at these links:

http://www.gnu.org/manual/tar/html_node/tar_125.html

And here is another good link:

http://pcunix.com/Unixart/unix_ba.html
Live Free or Die
melvyn burnard
Honored Contributor

Re: tar VS cpio

two other little points here, and that is cpio tends to be a little more confusing due to you having to include options on the recovery if theye were on th ebackupcommand line,
and tar will NOT back up device files where cpio will if you use the -x option .

The pax command will read/write both formats, by the way.
man pax
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Tim D Fulford
Honored Contributor

Re: tar VS cpio

tar is supposed to be vendor neutral, I don't think cpio is!

Tim
-
melvyn burnard
Honored Contributor

Re: tar VS cpio

And if I rememeber correctly, tar is also OS independant, as it ran on RTE as well as MPE and afew other non-Unix OS's
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Christoph Plattner
Occasional Advisor

Re: tar VS cpio

TAR also can copy device files, if the '/dev/xxxx'
are ment here. I often use
tar (GNU tar) to copy complete
root file systems.

with friendly regards

Christoph P.
Linux/UNIX-!FAN
Jan Affolter
Honored Contributor

Re: tar VS cpio

Hi,

Seems also that tar have a limitation, couldn't read tar archive greater than 2Gb.

Maybe this was corrected, could someone give more info about this ?

Take care !

Jan
Theory is good, pratice is better !
Mike Henderson
New Member

Re: tar VS cpio

Another invaluable piece of information on tar that I found in the forums not too long ago is that in maintaining industry compliance, HP did not make tar handle files larger than 2Gb, as mentioned in this thread. The work-around is:
dd if=/path/input-filename bs=10240k | compress -F - | dd of=/path/output-filename bs=10240k
To uncompress, do:
dd if=/path/input-filename bs=10240k | uncompress - | dd of=/path/output-filename bs=10240k