LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2014, 08:46 AM   #1
steak1987
Member
 
Registered: Jan 2012
Posts: 130

Rep: Reputation: Disabled
Question Difference between "tar.bz2" and ".bz2" ?


Whats the difference between both of the file formats. The reason I asked is because I have two DD images, both above 4GBs, lets say
Code:
foo.img.tar.bz2
and
Code:
foo.img.bz2
I understand that Tar is a method of creating [tape] archives and bz2 is Bzip2 which uses compression. So one file is a compressed tape archive [.tar.bz2] and one is a normal compressed archive [.bz2]

However, when I try to open the first file in the Gnome archive manager, the ".bz2" file loads instantly, while the "tar.bz2" takes a long time to be read.

Why though ?
Also, for the purpose of backup and data integrity, which is a superior format/container?

EDIT: I know the bz2 compressed disk image is 16Gb, but why is it listed as the compressed 12Gb in the archive reader, as opposed to the full 16Gb ?
EDIT2: Stranger still is that the tar.bz2 file is listed at the original, uncompressed size ...

http://imgur.com/yY4ahlj <---- bz2
http://imgur.com/bb2WQri <---- tar.bz2

Last edited by steak1987; 09-14-2014 at 09:04 AM. Reason: Added image and edit Question
 
Old 09-14-2014, 09:51 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,448

Rep: Reputation: Disabled
It takes longer to open the nested archive because the Gnome Archive Manager most likely treats it as a two-step process. It probably works like this: first, the bzipped archive is uncompressed to a temporary folder, and then the resulting tar file is sent to tar for processing.

If you do the same job using the command line and pipes, you'll see that the difference between a unpacking a tar file and processing a compressed tar archive becomes almost negligible (tar -xf file.tar vs. bunzip2 < file.tar.bz2 | tar -x or even tar -xJf file.tar.bz if your version of tar supports the "J" parameter for processing bzipped archives).
 
1 members found this post helpful.
Old 09-14-2014, 10:46 AM   #3
steak1987
Member
 
Registered: Jan 2012
Posts: 130

Original Poster
Rep: Reputation: Disabled
So is the discrepency in the compressed file sizes due to how the gnome archive program processes the files as opposed to the compression techniques?
 
Old 09-14-2014, 11:17 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,448

Rep: Reputation: Disabled
If the difference amounts to more than a few seconds for a 16 Gb file, then yes. There is some slight overhead associated with decompression, but certainly not enough to be described as "a long time".

I'm not familiar with Gnome archive manager, but it may be able to process tar files natively while relying on an external program or library for bzip decompression. That would make the difference even more pronounced.
 
1 members found this post helpful.
Old 09-14-2014, 10:11 PM   #5
steak1987
Member
 
Registered: Jan 2012
Posts: 130

Original Poster
Rep: Reputation: Disabled
weird. Well thanks for that quick summary. I guess ill simply stick to .bz2 from now on. Ill mask this as solved.
 
  


Reply

Tags
archive, backup, bzip2, tar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to extract a "tar.bz2" file? deWin Linux - Newbie 14 08-09-2016 08:49 AM
Unable to install softwares with ".tar.gz,.tar.bz2" extension yasasvi srikanth Linux - Newbie 4 09-11-2009 09:38 AM
Can't install ".tar.gz" and "tar.bz2" grapeape25 Linux - Desktop 4 08-14-2006 03:01 AM
how do you install programs extracted from "tar.gz", "bz2", etc? shoelessworm Ubuntu 13 04-12-2006 02:24 PM
compiling tar.bz2... "./configure make make install" doesn't work dodo1983 Linux - Newbie 7 08-17-2004 12:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration