Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-06-2007, 02:54 PM
|
#1
|
|
LQ Newbie
Registered: Jun 2007
Distribution: OpenSuSE 10.2
Posts: 13
Rep:
|
tar + split question
In a previous thread I asked how to create a tar archive that would allow me to limit the file size and break up automatically into incremental archives.
http://www.linuxquestions.org/questi...volume-603509/
I decided to use the split option as it is meant for this and the -M flag for tar really isn't.
Code:
tar -cvpj 'directory/name'/ | split -d -b 4000m - /name/of/archive.tar.bz2.
which produces something like...
Code:
archive.tar.bz2.00
archive.tar.bz2.01
archive.tar.bz2.02
My question is this. How with the existing file size limit can I extract the contents of one of these archives back to the file system. I can't reassemble the files onto the file system because they will break the 4GB limit. Is there a way that I can pipe cat through tar? Are their other alternatives still?
Any help is appreciated.
|
|
|
|
12-06-2007, 03:15 PM
|
#2
|
|
Senior Member
Registered: Oct 2003
Posts: 2,280
Rep: 
|
I don't think that's possible. Once you use split you have to join the files back together with cat before you can do anything else.
The real solution is to stop taring up your files to a FAT32 filesystem with its 4GB single file size limit. You shouldn't have this problem on any native linux filesystem.
|
|
|
|
12-06-2007, 03:39 PM
|
#3
|
|
Senior Member
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,300
Rep: 
|
Quote:
Originally Posted by 300zxkyle
My question is this. How with the existing file size limit can I extract the contents of one of these archives back to the file system. I can't reassemble the files onto the file system because they will break the 4GB limit. Is there a way that I can pipe cat through tar? Are their other alternatives still?
|
Try
# cat *.bz2* | (cd path-to-destination; tar jxv)
That should send a byte-stream through stdin to tar in the destination directory of your choice.
|
|
|
|
12-06-2007, 03:48 PM
|
#4
|
|
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530
Rep:
|
dar allows you to split archive files and retrieve files from the archive without having to assemble them into one huge archive file. It will even pause while you eject media and mount the next disk in a series.
Dar is a good replacement for tar if you are making archives for storing on removable media, although I think it's not suitable for tape backups (which is tar's job).
|
|
|
|
12-07-2007, 07:52 AM
|
#5
|
|
LQ Newbie
Registered: Jun 2007
Distribution: OpenSuSE 10.2
Posts: 13
Original Poster
Rep:
|
worked like a charm.
David,
The solution you provided worked like a charm. Thanks everyone for the input.
|
|
|
|
02-01-2011, 08:56 AM
|
#6
|
|
LQ Newbie
Registered: Dec 2010
Posts: 4
Rep:
|
thank you guys, nice post..
|
|
|
|
02-01-2011, 09:18 AM
|
#7
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,971
|
In the future, you might want to check 7z, which has been ported to a lot of architectures and can split the archives in volumes without needing external tools. With the default options it also provides a better compression ration and a lesser cpu usage, at least that's my perception (I am not really a fan of benchmarks).
|
|
|
|
11-22-2011, 04:47 AM
|
#8
|
|
LQ Newbie
Registered: Nov 2011
Posts: 3
Rep: 
|
Thanks a lot for the tips!
I recently used the above command to backup about 1TB of data into an external HD that was formatted as FAT32 and created a bz2 tar archive and then split it in 2GB chunks. Now that I am trying to access this data I am realizing that the numbering of the chunks goes from 00 to 99, which got me thinking that actually not all of the original data may have been backed up, given the suffix for the split files can contain only 2 digits.
Is there a way to change the format of the suffix to contain more than two digits?
Many thanks for your help!
|
|
|
|
01-14-2012, 12:39 AM
|
#9
|
|
LQ Newbie
Registered: Aug 2007
Location: Kochi
Distribution: Mandriva
Posts: 23
Rep:
|
Hello,
It is a good tip for us to backup files.
|
|
|
|
01-14-2012, 06:19 AM
|
#10
|
|
Moderator
Registered: Aug 2002
Posts: 10,756
|
scramble64
You might have already figured this out but AFAIK 100 files is the limit with digits. If the number suffixes was exceeded an error would of been displayed. You can use letters of length N using the -a option.
---------- Post added 01-14-12 at 01:20 PM ----------
scramble64
You might have already figured this out but AFAIK 100 files is the limit with digits. If the number suffixes was exceeded an error would of been displayed. You can use letters of length N using the -a option.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:17 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|