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 10-11-2009, 02:07 PM   #1
BiggySmalls
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Extract split tar.bz2 on server


Hello all,

I have 4 tar.bz2's on my server as you can see if the following screenshot.

http://screensnapr.com/u/1om5sg.png

I am trying to extract them all, this is the command I tried

Code:
cat *.bz2* | ( cd u; tar jxv)
This command seems to extract the

u.tar.bz2.00 100% with no issues. However, once it goes to the next one ( or one of the others, I can't be sure which is the culprit) I get an error like this.

Quote:
bzip2: (stdin*trailing garbage after EOF ignored
u/rqqv0z.png
That error comes up then it quits. Basically the only one that seems to fully extract is the .tar.bz2.00

Any help on this would be great, I have many images that I need to get outa of the tars.

Thanks!

Last edited by BiggySmalls; 10-11-2009 at 02:09 PM.
 
Old 10-11-2009, 02:35 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

How did you create those split tar-balls?
 
Old 10-11-2009, 07:58 PM   #3
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by BiggySmalls View Post
Hello all,

I have 4 tar.bz2's on my server as you can see if the following screenshot.

http://screensnapr.com/u/1om5sg.png

I am trying to extract them all, this is the command I tried

Code:
cat *.bz2* | ( cd u; tar jxv)
This command seems to extract the

u.tar.bz2.00 100% with no issues. However, once it goes to the next one ( or one of the others, I can't be sure which is the culprit) I get an error like this.



That error comes up then it quits. Basically the only one that seems to fully extract is the .tar.bz2.00

Any help on this would be great, I have many images that I need to get outa of the tars.

Thanks!
You need to make sure the files are concatenated in the proper order (this is not guaranteed). Do the files have alphabetic names, corresponding to their original order? If not, you cannot do what you are trying to do.

If they do, simply put them together, then untar them as a separate action:

$ cat *.bz2 > assembled.bz2
$ tar -xjf assembled.bz2 -C u

The '-C" argument tells tar to use a different directory than the source. Again, it's imperative that the files be assembled in the correct order, and this requires them to have alphabetically ordered names.

Last edited by lutusp; 10-11-2009 at 08:04 PM.
 
Old 10-11-2009, 08:20 PM   #4
BiggySmalls
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
You need to make sure the files are concatenated in the proper order (this is not guaranteed). Do the files have alphabetic names, corresponding to their original order? If not, you cannot do what you are trying to do.

If they do, simply put them together, then untar them as a separate action:

$ cat *.bz2 > assembled.bz2
$ tar -xjf assembled.bz2 -C u

The '-C" argument tells tar to use a different directory than the source. Again, it's imperative that the files be assembled in the correct order, and this requires them to have alphabetically ordered names.
This is the command I used.

Code:
tar -cvpj 'u'/ | split -d -b 1000m - u.tar.bz2
As far as the files that I tar-balled, no they are just randomly generated file names that were uploaded via a program. So there is no order to the original files (the pictures)
 
Old 10-11-2009, 09:05 PM   #5
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by BiggySmalls View Post
This is the command I used.

Code:
tar -cvpj 'u'/ | split -d -b 1000m - u.tar.bz2
As far as the files that I tar-balled, no they are just randomly generated file names that were uploaded via a program. So there is no order to the original files (the pictures)
I suggested a solution. Did it work? My comment was not about the order of the original files, but the order of the split segments. They must be reassembled in the same order as the original split.
 
Old 10-11-2009, 09:42 PM   #6
BiggySmalls
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
I suggested a solution. Did it work? My comment was not about the order of the original files, but the order of the split segments. They must be reassembled in the same order as the original split.
I assumed that since they were split and named .00, .01, .02 those are the order. If this is not true then I have no clue how to tell which order they are in.
 
Old 10-11-2009, 10:15 PM   #7
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by BiggySmalls View Post
I assumed that since they were split and named .00, .01, .02 those are the order. If this is not true then I have no clue how to tell which order they are in.
Again, I suggested a solution. Did it work?
 
  


Reply


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 tar.bz2 file? yuri16 Linux - Newbie 19 01-28-2009 01:49 AM
How to extract and install from .tar.gz and .tar.bz2 wstay Linux - Newbie 4 11-08-2008 11:14 AM
tar.bz2 Fails To Extract carlosinfl Linux - General 6 10-16-2005 01:33 PM
extract .tar.bz2 EcceVery Debian 3 11-24-2004 01:39 PM
How to extract tar.bz2 files? akihandyman Linux - Newbie 3 12-21-2003 04:17 PM

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

All times are GMT -5. The time now is 06:17 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