Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-10-2009, 12:23 PM   #1
Registered: Jul 2007
Posts: 137

Rep: Reputation: 15
Question Data recovery from formated disk?

I have formated my laptop disk several times in order to install windows and different versions of linux. when i formated the main drive and re-partitioned it, i lost my thesis which was located on the desktop of vista on C:drive (NTFS).

I didnt have any back up and now i want to recover that thesis. what do i do?
Old 03-10-2009, 01:37 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
1) See a psychiatrist: you are, clearly, an insane risk-taker.

2) Remove the HD and ship it to a disk recovery firm. $100-$10,000

3) Rewrite the thesis from scratch. Perhaps you'll do better the second time.

4) Remove the HD, install a new drive and (re)install Vista on it. Install the removed drive in a USB enclosure so it can be accessed from the new Vista. Purchase file recovery software. Try to do it yourself. (See suggestion #1, above.)
Old 03-10-2009, 02:02 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
Have you reinstall Windows on your first partition? Is it the same size? You might try the photorec program to recover the image. You shouldn't use this computer anymore, or at least don't use windows if the thesis is located in your new C:\ partition. If new files were saved over the location of the old files, then the covered files are lost. If the files you want are located in unsaved areas, you may be able to find it. It's also possible that parts are overwritten and parts aren't.

The first thing you should do is create an image backup of the partition. If you have resized or relocated the partitions since the thesis was overwritten, then create an image backup of the entire drive.

Google for: photorec testdisk

This article has links to both:


What kind of files is this thesis saved on? If you are composing it in LaTeX or another text file, you could use Grep on the partition device to locate a pattern you know is in the file. E.G. '\document' or perhaps for the title.

grep -ob --binary-files=text '' /openSUSE-11.1-DVD-x86_64.iso

This can help you zero in on where the file is. The number at the start is the zero based offset to the match. If the file is contiginous, and you can locate the start of it, you can use "dd" to cut out a part of the partition where the file starts. Then work on cutting off the excess to gain the original text back. You would be using the device node of the partition or drive instead of a file name.

This type of thing is a last resort when you can't recover the file itself.

Another thing to consider is to use losetup to attach a loop device at an offset, and then using the file command to identify what was found if anything. You could do this in a loop and filter out lines where nothing was found. You might try this is you already got a hit using grep and are trying to zero in on the start of the file.
It might look something like this:

for ((offset=1024;offset<=10000;offset+=512 )); do 
    losetup /dev/loop1 /dev/sda2 -o ${offset}
    file -s /dev/loop1
    losetup -d /dev/loop1
done | grep -v ': data$'
/dev/loop1: SysEx File -
The last line is a sample results running the code. The file command analyzes the type of file based on the contents, so you can use it when you don't know the filename or extension. I should really be doing this on a file image of the drive, but I'm not going to do that for a live example. Instead of /dev/sda2, the name of the file would be used.


Good Luck, but next time, perform backups and have copies in different locations. External drives, cdroms, pendrives, etc.

Last edited by jschiwal; 03-10-2009 at 02:11 PM.
Old 03-10-2009, 02:49 PM   #4
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
First thing to try is testdisk:

Make sure to save recovered data to a drive OTHER THAN the one you are recovering from or you might overwrite some data.

Second thing to try if #1 fails is foremost:
this is truly an awesome program, try it.

Third thing to try if the above fail is what PTrenholme suggests.

Note: it's best to run these from a different HDD with Linux installed and save data to that drive.

Last edited by H_TeXMeX_H; 03-10-2009 at 02:50 PM.


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
Recovery formatted data with ext3 disk? amaj1407 Linux - Hardware 6 07-22-2008 11:24 AM
Flash Disk Data Recovery (Pictures) GNewbie Linux - General 4 06-13-2007 01:47 AM
Data recovery from a crashed hard disk vharishankar General 8 11-01-2006 04:45 AM
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
data recovery from crashed disk. on boot grub promt appears vinshe Linux - Newbie 7 09-11-2006 06:18 AM > Forums > Linux Forums > Linux - Software

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

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
Open Source Consulting | Domain Registration