Posted on

Tutorial on how to successfully recover data from a Severely Corrupted hard drive in Ubuntu Linux using Testdisk and Photorec.

A “professional” repair shop attempted recovery of data from this Windows Laptop drive, but failed. Using Testdisk in Linux I recovered about 70% of the drive. (Could have been more, but it was crippling my system and running horrifically slow)

sudo apt-get install smartmontools
sudo apt-get install –no-install-recommends smartmontools

Find out drive number with GUI tools, Gparted, or “fdisk -l”
sudo smartctl -a /dev/sdx
sudo testdisk /dev/sdx
Take a backup image if you have enough disk space spare on your system
sudo photorec image.dd (or /dev/sdx)

find . -type f ( -iname “*.jpg” -o -iname “*.jpeg” -o -iname “*.png” ) -exec cp ‘{}’ /destination/ ;



43 Replies to “How to Recover Data from Corrupt Harddrive in Linux”

  1. I have one driver that i was using to make a bartop with arcade games in it to backup some data, but i forgot about it and one day turned the system on and it got bad blocks, and since i didn't want to mess with it and didn't have installed anything anyway i started formating it, but just as i pressed the format disk i remembered it and turned the system off, but of course the damage was made, so the question is: will it help me restore this hd or my data?

  2. Hi,Here is a problem:
    I have a 200GB internal pc hdd that was partitioned to have winxp and
    ubuntu 10 running on it. My windows xp needed to be redone fresh so I
    booted to an Ubuntu 16.04 LiveUSB to erase the partition using GParted. I
    then decided I wanted to resize my existing Ubuntu partition. I think I
    was going from about 100 to the full size of my hard drive. I started
    to see the task and waited about 5 min. I realized that the process was
    going to take a very very long time and so i used the" back button to
    start" to cancel the operation.but i don't validated the "apply botton"
    Now my problems begin. the pc not booting at all. Any hint about? Thanks in advance

  3. iv ran out of hdd space on a linux mint virtual machine now it wont boot and cant get it into recovery mode what should i do ???

  4. On my drive 32 hours does not even begin to make progress on the drive. It gets stuck with many bad clusters at the beginning. I believe that most of the disk later on is good. Is there any way to do the backup starting at the middle of a partition or maybe start at the end and go backwards?

  5. What do I do if Desktop Settings was open along with multiple other programs, and while using another program, it seemed to glitch and set parts of the bar with the icons far apart and off the screen, despite that I hadn't been using Desktop Settings during this?

  6. I've broken my android phone. I've lost it and when I found it, it was inside my wash machine. So the mobile is not turning on. If this process do you think is possible to recovery something? 😉

  7. I have the SAME HDD! Linux wrote over my partition and rooted it, and all my stuff is gone… Can I still recover my stuff or is it stuck on that Linux partition now?

  8. So you can only backup jpg, gif, png files with this app?
    So then how do I restore video files and other stuff?
    This is confusing, and I didn't know what to do in testdisk after searching through the HDD.
    Could you redo this tutorial but with normal / user-friendly apps please? And is there an app that will allow me to backup the HDD to multiple USB sticks because my disk doesn't have enough space?

  9. Please tell what do i should
    My hard disk (500 GB) loss during install kali linux
    How can i recover it
    Given me any solution

  10. Man,you are a lifesaver….My best friend just died recently in an accident,his family gave me his hdd,but it was non responsive,with your tutorial,i was able to recover all of his pics…..Thank You!!!

  11. my external drive has been corrupted i think i tried test disk on windows and it coundt find any partitions .. what are my options

  12. HELP HELP HELP while installing ubuntu i clicked on delete data and now
    my whole harddrive is formatted and all the partitions are removed
    please help me how can i get my data back

  13. just stumbled upon your channel and quid you're awesome! I don't understand how you don't have a bigger fan base. I will be showing my friends your channel! you make everything much more understandable. cheers man!

  14. hello can i mount the image.dd in some directory like in another external hard drive?thre reason behind is because i'm trying to recover data from 2TB corrupted external hard drive

  15. Oh… how I remember DOS many years ago, very simple just to load a prog.. then later trying to bring in a bot from a friends computer to an IRC channel 10 years ago gave me the sweats.. now this just scares me because I don't understand it.. all those instructions mean something in plain language.. it would be good if someone would define them.. If you know what they mean, you can understand better and remember them and what they do.. an old granny just saying 😉

  16. Hello, great tutorial!. thanks. Please, could you help me ?
    I already try recover from a Windows machine, but no sucess
    I got these error message executing command below:
    sudo ntfsfix /dev/sde
    Mounting volume… ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
    Record 0 has no FILE magic (0x0)
    Failed to load $MFT: Input/output error
    Attempting to correct errors… ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
    Record 0 has no FILE magic (0x0)
    Failed to load $MFT: Input/output error
    Failed to startup volume: Input/output error
    Checking for self-located MFT segment… ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
    ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
    Record 0 has no FILE magic (0x0)
    Failed to load $MFT: Input/output error
    Volume is corrupt. You should run chkdsk.

  17. Nice tutorial Quidsup … best i have seen……….. I use these recovery tools quite often . But GeeZus it irritates me how you lose ALL file names.

    I recently recovered 93,000 + photo's , 200+ movies  and over 500 short home video's ……………..32 hrs to recover it all ……… over 9 yrs of a family's  life, for a little ol Granny.  It was both a case of Happiness and joy at having gotten the photo's back ……………. And stress and anguish coz the poor ol dear didn't know what to do next. How do you put them back into folders and photo albums. ALL the info that was with them is gone. She mentioned that it would take her years to get it all sorted
    And some types of movies get broken down into their VOB sections ………… try putting them back together !!!     especially when there are no file names

    surely someone out there can improve this wonderful software further

  18. I had to do an emergency backup of an SD card containing a RPi image, using a Windows machine as the card was required for something ASAP. Turns out the image was corrupted and I lost some very important data. I can't mount the file at all on any of my linux machines.

    Could I use this tool to obtain data from an .img file?

  19. hey there,
    i use testdisk when pushed it's quite useful.
    as for the file naming well that is another matter.
    i did toy with the idea of writing a script to pull the info from the doc and rename them – using…. another utiliy (fileprop?)… wonder if you'd thought of that.

    in the meantime – another good vid – thanks.

  20. If you want to move all files with jpg OR jpeg OR png extension, then the command find should be:

    find . -type f ( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" ) -exec mv '{}' ../dest/ ;

    Thanks for your interesting videos. 🙂

  21. Good video 🙂 , but for some users could be more effective and comfortable to use PhotoRec Sorter 😉

Leave a Reply

Your email address will not be published. Required fields are marked *