LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   tar (https://www.linuxquestions.org/questions/programming-9/tar-747240/)

DEF. 08-13-2009 05:08 AM

tar
 
hmm perhaps this is not the most appropriate thread?

Anyhow, I have created a spanned archive using tar --tape-length

Any ideas how to reconstruct the original from the spanned archives?

jeromeNP7 08-13-2009 06:24 AM

--tape-length changes tapes after writing N*1024 bytes, so in the end it's basically a single tar file split onto several tapes. Copying all tapes to a large HDD and using cat is on way to join them, though I assume that tar will be able to read it's own tapes when the extract option is passed.
--multi-volume informs `tar' that it should create or otherwise operate on a multi-volume `tar' archive, being irrelevant if the volume is a tape or another device. In this case each volume is an independent tar file that can be used on it's own.
See 'info tar' for full documentation.

Linux

DEF. 08-13-2009 01:24 PM

Are you suggesting for example that for a spanned set of 1.tar 2.tar 3.tar I should use the following:

tar -xM 1.tar 2.tar 3.tar

As I found that tar did nothing?

karamarisan 08-13-2009 01:27 PM

I believe M only works if you used --multi-volume. Did you try his cat technique?

ta0kira 08-13-2009 06:03 PM

In addition to cat, you will probably need -i because of the possible padding at the ends of the tape:
Code:

dd if=/dev/tape bs=1024 count=N > tape1.tar #(etc.)
...
cat tape1.tar tape2.tar ... | tar -xvi

Kevin Barry

DEF. 08-14-2009 03:12 AM

Hi, OK cat did not work. I mean I did the following cat 1.tar 2.tar 3.tar > new.tar and the new.tar was created but the file new.tar failed to be extracted with a tar command following the cat. I noticed that new.tar was bigger than the original?

So I wonder if the tar command I used to archive the spanned set was at fault? *Sigh*

I will try tar with i.


All times are GMT -5. The time now is 11:42 PM.