[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tar ate my symlinks



Kevin, you are a life saver.

On Mon, Mar 17, 2003 at 03:36:37PM -0800, Kevin Buhr wrote:
>Sure, use:
>
>        tar tvfj linuxbackup.tar.bz2 | less
>
>and you'll get an "ls -l"-style directory listing.

That's very nice.  Takes a long time on a 3GB bz2'ed file, but it works.
:)

>I believe you've been bitten by a queer bit of "tar" behaviour.
[explanation snipped]

I believe you're right.  It was "exiting now" when untarring /proc,
which apparently prevented it from finishing the job.

>        tar -jtvf linuxbackup.tar.bz2 | egrep '^l' | \
>           perl -lane 'print "ln -snf $F[7] $F[5]" if (@F == 8 && $F[6] eq "->")' \
>           > FIX_MY_SYMLINKS

This gave me warm unix fuzzies like you wouldn't believe.  I had totally
forgotten about the -a flag to perl, and hadn't even thought of doing it
this way.  I was on this track, but I was using another debian box
instead of the tarfile as my source of information.  This is clearly a
much cleaner solution.

At any rate, I did this, and *poof*, it booted and ran without
complaint.  Thank you so much.

One last question.  I'm planning on doing a similar procedure to my
other machine.  Is there anything other than /proc that I need to
exclude?  I was surprised to find that /dev made it through intact.

(In case you're wondering, I partitioned the drives into many pieces
because I got them while ext2 was the stable choice.  Now that I have
ext3, I'd rather have one large partition, hence the backup/restore.)

Thanks again!

-- 
Brian



Reply to: