LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 07-31-2011, 11:44 PM   #1
Brigham
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
Recovering files deleted from tar.gz


No solution is offered in this thread for the titular issue. Turns out I had a back-up of the modified archive. I was unable to discover any method of recovering files deleted from an archive.

Two Lessons you might take before you leave:
1. Always keep a backup.
2. Always keep your backups Read Only!


Code:
$ chmod 555 filename
Is there any way to recover files deleted from a tar.gz archive?

I was looking through an archive (tar.gz) when instead of using "Backspace" to delete a portion of the address (in the address bar of the window), I hit "Delete". Instead of deleting the highlighted part of the address, the archive was instructed to delete all the files in the archive. Before I could react, all of my archived files had been deleted (gigabytes of info).

Unless my understanding of archives is flawed, I understand myself to be pretty solidly screwed.

Is there any way to recover these files once they've been deleted from an archive? My filesystem is ext4.

Thanks for any helpful direction you might give.

Last edited by Brigham; 08-01-2011 at 12:37 AM. Reason: Update.
 
Old 08-01-2011, 12:06 AM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
You could try:
Code:
$ lsof|grep "/path/to/file"
progname 5559 user 22r REG 8,5 1282410 1294349 /path/to/file
Notice the number in the second column is 5559 and the number in the fourth column is 22. The command to restore that file is:
Code:
cp /proc/5559/fd/22 restored.file

Last edited by micxz; 08-01-2011 at 12:06 AM. Reason: fix code tags
 
Old 08-01-2011, 12:29 AM   #3
Brigham
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Lightbulb

Thanks for the quick reply. Unfortunately, I had not deleted the actual tar.gz, but files within the tar.gz. I did test your advice with a dummy tar.gz, but the terminal simply returned another prompt after a few moments of deliberating the command you offered. Thus, I was unable to actually test whether this might work for files deleted from within an archive.

Thankfully, this test was unnecessary due to my paranoid redundancy. I managed to find a back-up of the archive which I hastily chmod-ed to read-only (per my usual practice. not sure why this wasn't so initially).

Still, thanks so much for your willingness to help, micxz.
 
  


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
Recovering Deleted files brew1brew Mandriva 6 12-24-2005 01:21 PM
Recovering deleted files?? DaFrEQ Linux - General 8 09-17-2005 12:28 PM
recovering deleted files saipraveen Linux - Newbie 1 06-16-2005 11:00 AM
recovering deleted files hamish Linux - Newbie 2 10-04-2004 05:51 PM
Recovering Deleted Files Brian of Gep Linux - Newbie 1 03-02-2004 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:20 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