LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2014, 07:31 AM   #1
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
how to recover files from corrupt tar.xz


I compressed some data into a tar.xz with the command

Code:
tar -cpJf archive.tar.xz -T dirlist.txt
Where dirlist.txt was the list of directories to include in the archive.
Now the archive is corrupt, and I cannot extract the files anymore:

Code:
root@host:/home/user# tar -xvJf archive.tar.xz
xz: (stdin): Datei Format nicht erkannt
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Any ideas what I could do?
 
Old 03-19-2014, 08:02 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
What is the output of:

Code:
file archive.tar.xz
and can you do a:

Code:
xzcat archive.tar.xz > archive.tar
without error?
 
Old 03-19-2014, 09:02 AM   #3
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Original Poster
Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by szboardstretcher View Post
What is the output of:

Code:
file archive.tar.xz
and can you do a:

Code:
xzcat archive.tar.xz > archive.tar
without error?
See requested output below

Code:
root@host:/home/user# file archive.tar.xz
archive.tar.xz: data
root@host:/home/user# xzcat archive.tar.xz > archive.tar
xzcat: archive.tar.xz: Datei Format nicht erkannt
I may have some info on why the corruption happened. The archiving was done through a cronjob which runs at 11pm. I found the following in /var/log/messages:

Code:
Mar 17 23:41:20 host kernel: [25521.939579] Out of memory: Kill process 3067 (java) score 53 or sacrifice child
Mar 17 23:41:20 host kernel: [25521.939596] Killed process 3067 (java) total-vm:1212484kB, anon-rss:13856kB, file-rss:0kB
Mar 17 23:42:47 host kernel: [25610.167962] xz invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, oom_score_adj=0
Mar 17 23:42:47 host kernel: [25610.167966] xz cpuset=/ mems_allowed=0
Mar 17 23:42:47 host kernel: [25610.167969] Pid: 6635, comm: xz Tainted: G           O 3.2.0-4-amd64 #1 Debian 3.2.54-2
Mar 17 23:42:47 host kernel: [25610.167971] Call Trace:
Mar 17 23:42:47 host kernel: [25610.167978]  [<ffffffff810b742a>] ? dump_header+0x78/0x1bd
Mar 17 23:42:47 host kernel: [25610.167983]  [<ffffffff8134fdc7>] ? _raw_spin_unlock_irqrestore+0xe/0xf
Mar 17 23:42:47 host kernel: [25610.167987]  [<ffffffff81097dce>] ? delayacct_end+0x72/0x7d
Mar 17 23:42:47 host kernel: [25610.167991]  [<ffffffff81164a56>] ? security_real_capable_noaudit+0x40/0x4f
Mar 17 23:42:47 host kernel: [25610.167994]  [<ffffffff8134fdc7>] ? _raw_spin_unlock_irqrestore+0xe/0xf
Mar 17 23:42:47 host kernel: [25610.167996]  [<ffffffff810b77f3>] ? oom_kill_process+0x49/0x271
Mar 17 23:42:47 host kernel: [25610.167999]  [<ffffffff810b7eee>] ? out_of_memory+0x2ea/0x337
Mar 17 23:42:47 host kernel: [25610.168003]  [<ffffffff810bbb85>] ? __alloc_pages_nodemask+0x629/0x7aa
Mar 17 23:42:47 host kernel: [25610.168006]  [<ffffffff811aeeba>] ? radix_tree_delete+0xc0/0x1d6
Mar 17 23:42:47 host kernel: [25610.168011]  [<ffffffff810e65ed>] ? alloc_pages_vma+0x12d/0x136
Mar 17 23:42:47 host kernel: [25610.168015]  [<ffffffff810d1194>] ? handle_pte_fault+0x165/0x79f
Mar 17 23:42:47 host kernel: [25610.168018]  [<ffffffff810ce7d5>] ? set_pmd+0x5/0x8
Mar 17 23:42:47 host kernel: [25610.168021]  [<ffffffff810ce865>] ? pte_offset_kernel+0x16/0x35
Mar 17 23:42:47 host kernel: [25610.168025]  [<ffffffff81352d2e>] ? do_page_fault+0x320/0x345
Mar 17 23:42:47 host kernel: [25610.168029]  [<ffffffff8100d750>] ? __switch_to+0x1e5/0x258
Mar 17 23:42:47 host kernel: [25610.168033]  [<ffffffff810fab68>] ? vfs_read+0xb8/0xe6
Mar 17 23:42:47 host kernel: [25610.168036]  [<ffffffff81350335>] ? page_fault+0x25/0x30
Mar 17 23:42:47 host kernel: [25610.168038] Mem-Info:
Mar 17 23:42:47 host kernel: [25610.168039] Node 0 DMA per-cpu:
Mar 17 23:42:47 host kernel: [25610.168041] CPU    0: hi:    0, btch:   1 usd:   0
So it seems the process ran out of memory while archiving? The part I don't understand is that the archive has a timestamp of 14:03pm
Code:
root@host:/var/backups/entwickler# ls -halt
insgesamt 388M
drwxr-xr-x 3 root root 4,0K Mär 19 13:21 ..
drwxr-xr-x 3 root root 4,0K Mär 19 13:07 .
-rw-r--r-- 1 root root 389M Mär 18 14:03 archive.tar.xz
-rw-r--r-- 1 root root   31 Feb 17 18:23 dirlist.txt
The machine might have been rebooted somewhere in that timeframe yesterday...
 
  


Reply



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
How to recover files from a corrupt Win XP-partition Ike-dP Linux - Newbie 1 10-05-2011 07:06 AM
seemingly corrupt downloaded gzip'd tar files merlinblack Linux - Software 3 02-03-2010 11:35 PM
Recovering files from corrupt TAR archive... johnwyles Linux - Software 8 04-17-2006 04:44 AM
Help! Need to recover corrupt bzip2 files.. rhinomite Linux - General 3 02-15-2005 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:16 PM.

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