Amanda-Users

Re: how to dd if=... a chunked dump blob?

2005-12-06 10:33:22
Subject: Re: how to dd if=... a chunked dump blob?
From: Will Partain <will.partain AT verilab DOT com>
To: amanda-users AT amanda DOT org
Date: Tue, 06 Dec 2005 15:14:44 +0000
I asked:

>>>   dd if=foo.verilab.com._.1 bs=32k skip=1 | tar tfv - | sort +2nr | head
>>> 
>>>What if, instead, my dump blob is "chunked", as in this case (1GB chunks):

Alexander Jolk suggested (one of two possibilities):

>> Well, you either do some shell magic:
>> for i in foo.verilab.com._.1*; do dd if=$i bs=32k skip=1; done | tar tvf ...

Gerhard den Hollander followed on with:

> or simply
>
> cat foo.verilab.com._.1* | dd bs=32k skip=1 | tar tfv - | sort +2nr | head

Alexander's solution definitely works.  Gerhard's solution may do
something sensible, but I would classify it as "wrong" -- sorry :-(

If each chunk has an Amanda header on it (as it appears it does), then
you need something like Alexander's solution to strip them off.

With Gerhard's solution, I get ...

   % cat *.0* | dd bs=32k skip=1 | tar tfv - | sort +2nr
   tar: Skipping to next header
   tar: Skipping to next header
   ... etc...

... which means 'tar' is having to do some guesswork, which I don't
like.  The results I'm seeing on my sample run suggest it is *not*
"skipping" to the right place; i.e. the results are wrong.  The Jolk
way is the best way!

Thanks for the useful thoughts,

Will


<Prev in Thread] Current Thread [Next in Thread>