Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 12-08-2012, 03:21 AM   #1
Registered: Oct 2008
Location: Boise, Idaho
Distribution: Debian GNU/Linux (Jessie) + KDE
Posts: 168

Rep: Reputation: 4
Corrupted *.tar.gz file throwing error.

I just migrated my Documents folder contents to a new installation on a desktop computer from a laptop. Disc drive on the laptop went out so I had to send it in for recycling.

In the process of migrating the contents, I created (out of ignorance, by the way) a gzip file that became corrupt in the process of getting it to my desktop hard drive.

Read around and tried a gzrecover utility, which did not work. I have tried many other things and have spent hours on it, getting to what seems to be nowhere.

Does anybody out there have a surefire way to uncorrupt the file or get out the remaining contents of the file that are still intact?

Much thanks in advance for your help.
Old 12-08-2012, 04:32 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Did you try the cpio option mentioned in the gzrecover site?

The tables used for compression are built using data previously encountered. Some of the files after the corruption won't be recovered correctly as a result. I think a sliding window is used so after so many bytes of corrupted files, you may start getting correct output.

If the file was truncated, you will be out of luck, as there is nothing to recover.

The cpio method is used because tar can't handle the region of file corruption from gzrecover.

Gzrecover corrupted-backup.tar.gz
cpio -F corrupted-backup.tar.recovered -i -v
Old 12-08-2012, 09:50 AM   #3
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 2,890

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
Success in recovery depends on just how the corruption occurred. If the problem is due to an FTP ASCII-mode transfer from a Linux machine to Windows machine, then the corruption was non-destructive (inserting a CR character ahead of each LF character), and there is a program called fixgz that has a good chance of repairing the file. If the transfer was in the reverse direction (Windows to Linux), then the corruption was destructive (removal of every CR immediately followed by LF) and recovery may be impractical (not impossible, but probably beyond what is reasonable for data that wasn't important enough to be backed up).
Old 12-08-2012, 10:01 AM   #4
Registered: Oct 2008
Location: Boise, Idaho
Distribution: Debian GNU/Linux (Jessie) + KDE
Posts: 168

Original Poster
Rep: Reputation: 4
gzrecover threw an error when I tried to get an output. It said

# gzrecover: Command not found.

I don't think I have it installed properly.

What is the proper way to install it?

Old 12-08-2012, 10:35 AM   #5
Registered: Oct 2008
Location: Boise, Idaho
Distribution: Debian GNU/Linux (Jessie) + KDE
Posts: 168

Original Poster
Rep: Reputation: 4
I have done some reading around and have decided to give up on the effort of trying to extract my good data from the archive. Thanks anyway for your help, but for now, it is not needed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
.tar.gz file and possibly corrupted rjo98 Linux - Newbie 10 02-20-2011 04:17 PM
"Invalid tar magic" error msg. when I try to tar ldmud *.tar file in DSL pixxi451 Linux - Newbie 4 07-04-2010 08:32 AM
Installpkg ignoring tar-1.13; throwing up warning while installing packages corbis_demon Slackware 2 09-07-2009 03:44 AM
Tar gives error when creating a tar file archive davidas Linux - Newbie 10 04-13-2004 12:35 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 01:04 PM

All times are GMT -5. The time now is 05:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration