LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-13-2010, 12:06 AM   #1
oryan_dunn
Member
 
Registered: Sep 2002
Location: Auburn, IN
Distribution: Fedora/Red Hat/CentOS
Posts: 68

Rep: Reputation: 15
ran mkfs.vfat over top ntfs partition... any way to restore ntfs partition info?


Title basically says it all. I was attempting to format a flash drive, and well, used the wrong sdX device. I've run DiskInternals Partition Recovery tool, and all my files are still there (you have to pay $139 to have it restore the files). Is there any way using tools in linux to restore the ntfs partition/files? It was a single disk with the partition taking the entire drive. I've tried mounting it with the -t option, but it says invalid ntfs signature. Man, two lessons the hard way, make sure you backup (duh) and be careful what you type as root.
 
Old 10-13-2010, 12:38 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by oryan_dunn View Post
I've run DiskInternals Partition Recovery tool, and all my files are still there (you have to pay $139 to have it restore the files).
There is a GNU licensed tool called photorec which you might be able to use to recover the files. It won't recover the directory structure though.

Quote:
Is there any way using tools in linux to restore the ntfs partition/files?
Unfortunately it isn't the partition format that you have corrupted, but the actual filesystem itself. It would be difficult to recover the filesystem. Not impossible, since the FAT format will have only written a few sectors, but hard to do with any sort of automated tool (since I'm guessing that the root directory at least will have been partially destroyed).

Just forcing it to use NTFS format is not going to work, because it isn't just a bad partition identification.

Quote:
Man, two lessons the hard way, make sure you backup (duh) and be careful what you type as root.
Typing the wrong device name - an easy mistake to make. Not having backups? What can I say!

Last edited by neonsignal; 10-13-2010 at 12:43 AM.
 
Old 10-13-2010, 12:46 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,959

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Have a read through this thread. Last post has one happy camper.
 
1 members found this post helpful.
Old 10-13-2010, 09:27 AM   #4
oryan_dunn
Member
 
Registered: Sep 2002
Location: Auburn, IN
Distribution: Fedora/Red Hat/CentOS
Posts: 68

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by neonsignal View Post
There is a GNU licensed tool called photorec which you might be able to use to recover the files. It won't recover the directory structure though.
The drive had lots of stuff in many directories, so I'm not sure photorec would really get me what I want, but I'll give it a shot to see if i can save some money.


Quote:
Unfortunately it isn't the partition format that you have corrupted, but the actual filesystem itself. It would be difficult to recover the filesystem. Not impossible, since the FAT format will have only written a few sectors, but hard to do with any sort of automated tool (since I'm guessing that the root directory at least will have been partially destroyed).

Just forcing it to use NTFS format is not going to work, because it isn't just a bad partition identification.
I was just wondering if I could reformat the partition with a new NTFS, then run a chkdsk on the drive if it would find and restore the files. I guess that would be far to simple of a fix.

Quote:
Typing the wrong device name - an easy mistake to make. Not having backups? What can I say!
Well, you see, my backup routine was already set in my head, and I had good intentions, just never put in the time to fully implement it. I had setup a CentOS server that I was going to have a cronjob do a daily or weekly copy, or somehow set it up as a mirror, and as you can see, I didn't really have it figured out as to how to do it. Luckily, most of the really important stuff I had backed up, but if I don't get the drive back, I'll lose about a year worth of pictures, as well as other backups stored on that drive from other computers.

Quote:
Originally Posted by syg00 View Post
Have a read through this thread. Last post has one happy camper.
I'll give the GetDataBack demo a try. It's a bit cheaper, but only does NTFS. It almost seems that if I have to buy a program to do this dirty work, I'd want one that would work for more than just NTFS.
Member KimVette in this thread recommends R-Studio http://www.linuxquestions.org/questi...1/#post1686091

Last edited by oryan_dunn; 10-13-2010 at 09:38 AM.
 
Old 10-13-2010, 09:47 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,959

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by oryan_dunn View Post
I was just wondering if I could reformat the partition with a new NTFS, then run a chkdsk on the drive if it would find and restore the files. I guess that would be far to simple of a fix.
I have done similar on ext3 (mkfs.ext3 -S) and it actually worked. However this was a tightly controlled test on a newly constructed filesystem (no updates/reallocations, just new files).
I wouldn't be betting my house that it'd work on NTFS.
 
Old 10-13-2010, 09:56 AM   #6
oryan_dunn
Member
 
Registered: Sep 2002
Location: Auburn, IN
Distribution: Fedora/Red Hat/CentOS
Posts: 68

Original Poster
Rep: Reputation: 15
Another lesson I've learned is that it is near impossible to find reputable reviews for this type of software. I think there are so many sites that play on people's fears, that finding actual professional reviews is quite a challenge. So far, I've found this article Data Recovery Software Roundup -- Don Your Detective Cap and Find Your Missing Data! [maximumpc.com]

Quote:
Originally Posted by syg00 View Post
I have done similar on ext3 (mkfs.ext3 -S) and it actually worked. However this was a tightly controlled test on a newly constructed filesystem (no updates/reallocations, just new files).
I wouldn't be betting my house that it'd work on NTFS.
The drive in question is a WD2500JB, and I happen to have two of them; so I was considering doing a dd copy from one to the other, and just start messing around on the destination drive.

Edit:
I really hate cross-linking to another forum, but there is a long discussion on slashdot about which tools to use.
Slashdot | What Data Recovery Tools Do the Pros Use?[slashdot.org]
It seems the general consensus is GetDataBack is the way to go. I first want to see what my dd-reformat-chkdisk can do, then I'll try the photorec, just for fun, and I also want to try the free Recuva. Even though I've lost the files, I'm pretty confident I can get them back, so I'm just going to use this as a learning experience for working with "dead" drives.

Last edited by oryan_dunn; 10-13-2010 at 01:28 PM.
 
Old 10-14-2010, 10:05 AM   #7
oryan_dunn
Member
 
Registered: Sep 2002
Location: Auburn, IN
Distribution: Fedora/Red Hat/CentOS
Posts: 68

Original Poster
Rep: Reputation: 15
Well, I tried the reformat at NTFS on my copied drive, then ran the check for errors tool in Windows 7, and it said everything was fine. I wonder if there is a way to force a deep scan check disk from windows?
 
Old 10-14-2010, 06:12 PM   #8
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by oryan_dunn View Post
Well, I tried the reformat at NTFS on my copied drive, then ran the check for errors tool in Windows 7, and it said everything was fine. I wonder if there is a way to force a deep scan check disk from windows?
When you do the NTFS format, it creates a new empty file system, so it looks completely normal. It doesn't matter what is in the sectors marked as empty, because chkdsk is not a recovery tool.

What chkdsk does is search the file system for file entries that are corrupt, for example two files stored on the same area of the disk, or areas that have no file entries but are not marked empty. And in general it doesn't recover files, it just removes entries that have problems so as to maintain a consistent file system. Since you created a new empty file system, there were no file entries to check, so chkdsk will not find any problems.

The full disk option in chkdsk is just to search for bad sectors; it does not search for data on the whole disk.

Some of the proprietary recovery tools might be able to reconstruct the root directory (the rest of the directories might be intact anyway). They usually have gratis demo versions that you can try. Typically the demo versions show you what they think they can recover, but do not do the actual recovery. I don't have a recommendation on a proprietary tool.

Otherwise the fallback is to do file-by-file recovery. Might not be so bad if your photos have unique filenames, but yes, it is painful to do this for a lot of files.

Last edited by neonsignal; 10-14-2010 at 06:21 PM.
 
Old 10-14-2010, 07:08 PM   #9
oryan_dunn
Member
 
Registered: Sep 2002
Location: Auburn, IN
Distribution: Fedora/Red Hat/CentOS
Posts: 68

Original Poster
Rep: Reputation: 15
I think if the root directory could be reconstructed, I'd get back almost all my data. I used Recuva, and it seems to have found everything, even the directory structure. A few of the directories that were in the rood of the drive, the name was lost, but their content was still fine.
 
  


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
recovering a 'ntfs' partition which got ruined by mkfs.ext4 command jagsir Linux - General 6 09-19-2010 08:53 AM
Ping Linux unable to restore backup on NTFS partition casigui88 Linux - Newbie 4 07-23-2010 04:33 PM
Best way/tool to back up and restore an NTFS partition with bad sectors? Robert Carnegie Linux - Software 3 01-27-2010 08:56 PM
Is it possible to redirect move /home to my NTFS / vfat XP-My Docs partition ? kcoriginal Linux - General 2 08-14-2008 12:49 AM
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration