LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Disk recovery using testdisk (https://www.linuxquestions.org/questions/linux-newbie-8/disk-recovery-using-testdisk-816872/)

Goodwater 06-28-2010 05:18 PM

Disk recovery using testdisk
 
Hi.

This is my first post on this forum, and I just started using Linux (ubuntu) yesterday.

So this is my problem: I was installing ubuntu and somehow formatted the D partition on my hdd. I have installed testdisk and have been running quick search and deep search. Testdisk found my partition as a NTFS (I used windows vista). When I press P to list files, testdisk gives me the following message: Cant open filesystem. Filesystem seems damaged.

Is it possible to recover any data from the partition or is it lost?
Any help will be greatly appreciated, as alot of my documents for school is lost (I will be better at backup).

PTrenholme 06-28-2010 05:54 PM

testdisk is usually fairly good about finding things, but with the NTFS directory information lost by formatting the partition, I'd suggest you try foremost which looks for file signatures and can sometimes pick out file fragments for you to stitch back together. (This is neither fast nor easy.) The problem with Windows files is that they are quite often fragmented on your disk unless you defragmented quite often. (Most Linux file systems avoid fragmenting files unless your disk is critically full.)

There's also ntfsundelete, but I believe that that program is only usable if the NTFS is intact.

Suggestion: If you have the disk space, make an image of the problem partition (using, for example, dd_rescue) and then work with the image instead of the actual partition. (I.e., backup the damaged partition before mucking with its contents. One hopes you've now learned the value of a backup.)

Once you've got the partition backed up, you could try a Windows quick format on it (which should make it a NTSF partition with an empty directory) and then see if ntfsundelete can find anything there. (I think - but haven't checked - that ntfdundelete is part of the ntfs-tools package.)

onebuck 06-28-2010 07:21 PM

Hi,

Welcome to LQ!

You installed 'testdisk' where?

If you touched the formatted drive with any writes then possible or potential loss of data that won't be recoverable nor accessible.

You usually boot a LiveCD with 'testdisk' then attempt to recover data/files. Always work from a backup or image of the drive in question.

:hattip:


All times are GMT -5. The time now is 08:17 PM.