Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Topics

Recent Status Updates

View All Updates

Photo
- - - - -

A simple way of getting your files back from a corrupted partition

hdd ssd partition corrupted data testdisk

  • Please log in to reply
3 replies to this topic

#1 Yannbane

Yannbane

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 238 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, PL/SQL, Lisp, Assembly, Bash, Others
  • Learning:Lisp, Scheme

Posted 26 March 2013 - 09:39 AM

This week, a friend of mine came to me with a non-functional HDD. There were two partitions on it: the first one, used for booting and system files, which wasn't corrupted, and the second one, on which he kept critical data (and large amounts of it).

The second one couldn't be mounted be neither Linux nor Windows, as Linux kept reporting various seriously-looking NTFS errors. On the topic of NTFS, it seems really ancient, closed, unportable and inefficient. We're in 2013 and it still has those awful fragmentation problems?! No permission?! What a joke of a filesystem...

Anyway, due to not having an external HDD container, I had to open up my PC and connect his HDD to it. While booting, Linux reported some errors about it, which was a bit strange. I can't remember what they were, as I forgot to write them down.

Anyway, once I was up and running, my PC could read the first, uncorrupted partition, as I had expected. However, there was no sign of the second one.

Well, if you have such a problem - or any other problem with your HDD (as long as the data itself isn't heavily damaged) - there's a solution!

The solution is called Testdisk. It's a free and open source data recovery tool (CLI) developed by CGSecurity.
apt-get install testdisk
should do the trick.

When you've installed Testdisk, run it by giving it root permissions (sudo testdisk, e.g.). I chose "no log" as the logging option, as I didn't really need one. After that, select the correct media and the partition table type (you should probably go with the default selection (Intel)). After that, you're presented with a menu. You should go under the "Advanced" tab, after you've ran the analysis (default selection), as it offers you a way to navigate through files.

Once you're in the advanced tab, you should see a listing of your partitions. Select the one you're interested in, and go with the "List" option.

And, voila, all your files are right there (hopefully)! You can select the most important ones, and copy them to a desired location.

I hope that this short tutorial helped you. :)
  • 1

My blog: yannbane.com. I post about programming, game development, and artificial intelligence.


#2 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 26 March 2013 - 10:16 AM

Try throwing the drive in a ziplock bag and put it in the freezer.  It is known to temporarily make the disk usable.  Maybe you can get everything you need off of it.  


  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#3 Yannbane

Yannbane

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 238 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, PL/SQL, Lisp, Assembly, Bash, Others
  • Learning:Lisp, Scheme

Posted 26 March 2013 - 02:55 PM

Try throwing the drive in a ziplock bag and put it in the freezer.  It is known to temporarily make the disk usable.  Maybe you can get everything you need off of it.

I can't really tell whether that's a joke or not, but the problem we experienced had to do with a corrupted NTFS, not malfunctioning hardware. :)
  • 0

My blog: yannbane.com. I post about programming, game development, and artificial intelligence.


#4 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 27 March 2013 - 01:32 PM

Bookmarked that utility, could get handy in the future, thanx for sharing!

 

About the freezer, does it still work for new drives? I've heard about that a long time ago, I'm not sure how different legacy hardware is to the latest, freezing-wise.

It would work on a good old IDE with certain minor damage level, but I have no idea if that applies to regular actual disks


  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download