LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-31-2008, 07:29 PM   #1
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Rep: Reputation: 32
Urgent!!! Recovery of data


Hi,

I managed to accidently wipe some important folders containing about 24GB of data using the rm tool from the terminal with the wildcard flag * set which prompted the unwanted erase.

Does anyone know how to get it back?

I haven't touched the disk since it's a secondary drive currently.

If anyone knows anything I would be SOOOOOO greatfull

Thanks

**OS is Debian Etch
 
Old 10-31-2008, 08:00 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
More than likely, it's gone for good. If it's on an ext2 system this may help: http://www.stud.tu-ilmenau.de/~mojo/undelete.html. It's on an ext3 system, I've read that you're out of luck. Someone recommended photorec which is part of the testdisk package. You should also do a search here on LQ on the phrase "recover deleted data".
 
Old 10-31-2008, 08:09 PM   #3
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
It's ext3 filesystem but since it's a drive which doesn't get written to just read from maybe there might be a way to recover it?

Each file size is about 350MB and I've unmounted the drive already.

I don't know if there's software that can get it back or if somehow using the CLI I can recover it?
 
Old 10-31-2008, 08:30 PM   #4
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
I've just searched high and wide on everything and lots for ext2 and text plus document files but mine are video files! .avi format.

I have found this page which hopefully will help me but I have to try out a little.
 
Old 10-31-2008, 08:55 PM   #5
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
The site I found was here: http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html

which is a program called ext3 grep.

However I have no idea what it's talking about when it says $IMAGE, plus it seems like again this software is for text files??

Uh I have a headache now I didn't even use the rm -rf command just rm on it's own aaaah oh well 60 videos lost to the abyss which is my hard drive!
 
Old 10-31-2008, 09:12 PM   #6
richwmn
LQ Newbie
 
Registered: Dec 2005
Location: Athens, GA
Distribution: Slackware (various),Ubuntu 9.04
Posts: 27

Rep: Reputation: 17
There is an undelete function in the latest versions of midnight commander which may help you. It works on an unmounted partition. Google midnight commander undelete and you should get some information on it.

Rich
 
Old 10-31-2008, 09:14 PM   #7
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
hmm just thought I might be able to use the software on my system however it won't compile as it needs another component which is not available through apt and I'm sure they will complain that Debian's lib files and other files are too old uh

It was gona be a nice evening tonight just me and the computer but now has turned into a disaster, oh well maybe after some sleep I might become lucky or if anyone has any other suggestions it would be great!
 
Old 10-31-2008, 09:15 PM   #8
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Quote:
There is an undelete function in the latest versions of midnight commander which may help you. It works on an unmounted partition. Google midnight commander undelete and you should get some information on it.

Rich
Oh thanks Rich was just typing I think when you posted!

I will apt-get m-c now and take a look quickly before turning in for the night.
 
Old 10-31-2008, 09:32 PM   #9
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Google'd for mc but unfortunately everything came up with the fact that it won't work for ext3 and not for the size of data I'm talking about either

I found somewhere that said you can do it through the /proc directory: http://glandium.org/blog/?p=87

But still I haven't had any luck mainly as I'm not sure what to read in the /proc directory.

Ok time for me to turn in now, maybe I'll get lucky tomorow?
 
Old 11-01-2008, 10:09 AM   #10
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Ok well after a lot of searching and reading I discovered The Sleuth Toolkit and Autopsy, also Magicrescue.

http://www.student.dtu.dk/~s042078/magicrescue/

http://www.sleuthkit.org/sleuthkit/

Magicrescue seems to be for corrupted patitions and The Sleuth Kit more for forensic analysis, one of these tools is going to work somehow for me but at the moment I'm not understanding their manual pages!!

They keep talking about using an image of the drive but don't tell you how to create one or where to put it to use it?

Looks like more reading needed!
 
Old 11-01-2008, 10:40 AM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
In worst case scenario you can still recover files with intact headers using foremost.

Next time you should try to use a wrapper to prevent deleting of very important stuff, for example I use this:

Code:
#!/bin/sh

# this script takes only 2 arugments total
if test "$#" != 2
then
  # fail
  echo 'ERROR: This script requires exactly 2 arguments'
  exit 1
fi

# don't delete things 2 levels from the root directory
if find / -type d -maxdepth 2 | grep "$2" 1> /dev/null
then
  # fail
  echo "ERROR: Bad idea, will not remove $2"
  exit 1
fi

rm "$1" "$2"

# success
exit 0

Last edited by H_TeXMeX_H; 11-01-2008 at 10:43 AM.
 
Old 11-01-2008, 10:48 AM   #12
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Thanks H_TeXMeX_H, I will have a look at the manual and howtos for foremost.

Since I just need to recover these files and nothing major I need fast quick and simple, but obviously if it takes time then it will take as long as it needs!!
 
Old 11-01-2008, 11:17 AM   #13
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Ok done the reading, currently two major questions come to mind:

1. What is the image.dd file that everyone talks about and how do I create one?

2. Can I recover the file names used aswell, is this the function of foremost?

I've run magicrescue and it's cycling currently but the names are not there, well actually I don't see the proper files there either yet as it claims that there isn't sound on any file??

Thanks
 
Old 11-01-2008, 11:28 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
You use 'dd' to create image.dd, say you have a partition called /dev/hdb1, to make at image you run this from a different partition:

Code:
dd if=/dev/hdb1 of=image.dd
This will make byte for byte copy of the partition to a file called image.dd (it will be large). Then you can scan that image using foremost or other tools.

No tool that I know of can recover file names, sorry.

Oh, and be careful using dd it stands for data destroyer.

Last edited by H_TeXMeX_H; 11-01-2008 at 11:30 AM.
 
Old 11-01-2008, 11:57 AM   #15
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Thanks for the tip!

I have no idea if this will work as magicrescue has only found 4MB videos so far and not the 350MB ones that I need, mind you it is a 250GB drive with only one partition spanning the drive so I guess be patient and hope for the best.

If not I will try The Sleuth Tookkit and see if that works, although I don't have anywhere to put the image file if as you say the image is of the partition as that would mean 250GB - oh boy... hmm an external drive might do the trick here.

Well using the command you gave:

Quote:
dd if=/dev/hdb1 of=image.dd

This will make byte for byte copy of the partition to a file called image.dd (it will be large). Then you can scan that image using foremost or other tools.
Would that mean that the information in the drive will be lost but instead transferred to the image?

So say where output of=image.dd will be in a directory, eg. /usr/image or /mnt/external_drive/image
 
  


Reply


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
LXer: Linux Data Recovery on Windows - Is possible through Disk Doctors Linux Recovery Software LXer Syndicated Linux News 0 10-22-2006 12:21 PM
Urgent Help In Recovery khaleel5000 Linux - Software 3 10-30-2005 01:27 AM
Urgent Help In Recovery khaleel5000 SUSE / openSUSE 1 10-29-2005 12:21 PM
urgent!data recovery! mathman0 Linux - Software 1 01-18-2005 02:54 AM
URGENT - data recovery help needed GoremanX Linux - General 5 08-03-2002 04:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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