From owner-freebsd-questions@FreeBSD.ORG Tue Feb 14 03:38:24 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28497106564A for ; Tue, 14 Feb 2012 03:38:24 +0000 (UTC) (envelope-from pancakeking79@gmail.com) Received: from mail-lpp01m020-f182.google.com (mail-lpp01m020-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 992398FC14 for ; Tue, 14 Feb 2012 03:38:23 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so4162001lbb.13 for ; Mon, 13 Feb 2012 19:38:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JEEbJOa/hdR8ueB3ZYQSd2322njQqirMF6z1QJTnZOA=; b=DA+lSFPXMh0R1aga/jhujsu+q9xtkxTowm+9A9RDNu9nkHrsUpibiSCke2XBG8jJfn kR5lq3JyT30FIC9ks2dIl+Naz0mwDsZoRI5AtSLfoSM1mf2FT7X2VrltbVoYgPkMLLpt ZzRu1wmJK/4uxXiCopLjnMSk4LmrwKMOsUCoI= MIME-Version: 1.0 Received: by 10.112.8.41 with SMTP id o9mr6710842lba.9.1329190702279; Mon, 13 Feb 2012 19:38:22 -0800 (PST) Received: by 10.152.113.68 with HTTP; Mon, 13 Feb 2012 19:38:22 -0800 (PST) In-Reply-To: References: Date: Tue, 14 Feb 2012 04:38:22 +0100 Message-ID: From: _ To: APseudoUtopia Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions Subject: Re: corrupted tar.gz archive - I lost my backups :)/:( X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 03:38:24 -0000 2012/2/14, APseudoUtopia : > On Mon, Feb 13, 2012 at 8:56 PM, _ wrote: >> Hi, >> >> Before making the move from 7.0 to 8.2, I ran a little script that did a >> backup of selected files >> and folders. >> >> Trying to recover these files on 8.2, I found that some of the archives - >> unfortunately those with >> the files that are dear to me - are corrupted. >> >> In other words, I just wanted to ask if there's anyone on here, who knows >> of a good repair >> utility for corrupted tar.gz archives? >> >> Thanks >> >> pancakeking79 > > Hrm....What command/script did you run to create the archive? How did > you transfer it over to the new system? What command are you using to > attempt to extract it, and what error is it giving? > > You can try: > gunzip < archive.tar.gz > archive.partial.tar > Which may or may not giving you some of the files into the > archive.partial.tar file. > > What does gzip --test archive.tar.gz give? > I don't have the script anymore. It is among the files lost, but it was pretty much straight forward, making use of: tar -czf backupfile.tar.gz folders/ of/ my/ choice/. After creating the backups I just cp(1)ed them to an msdosfs formated usb stick and got them onto 8.2 this way, so the famous ascii/binary trap shouldn't be an issue here. Here are some of the outputs I get: # ls setcd12292011.tar.gz su12292011.tar.gz sr12292011.tar.gz # tar -xvf sr12292011.tar.gz x root/ [snipped] tar: Error exit delayed from previous errors. # tar -xvf su12292011.tar.gz x usr/home/user/ [snipped] tar: Damaged tar archive tar: Retrying... tar: Damaged tar archive tar: Retrying... tar: Damaged tar archive tar: Retrying... tar: Damaged tar archive tar: Retrying... tar: Damaged tar archive tar: Retrying... tar: gzip decompression failed tar: Error exit delayed from previous errors. # gzip --test sr12292011.tar.gz gzip: data stream error gzip: sr12292011.tar.gz: uncompress failed # gunzip < sr12292011.tar.gz > archive.partial.tar gunzip: data stream error It recreates something, but the most important files, which reside in subfolders of the given tar.gz archives are gone, i.e. the subfolders are empty. The gunzip strategy you mentioned yields the same as a regular tar -xvf file.tar.gz. Pegasus, I have yet to try the pax(1) approach. I will let you know about how that went.