NTFS partition can't be mounted in either Windows or Ubuntu
A few days ago I decided to backup important files and pictures from my old laptop. After failing to boot Windows several times, I decided to transfer the pictures using an Ubuntu live USB, because everything was faster when I accessed the hard drive of pictures through Ubuntu, but then a problem happened, and the computer suddenly shut down. When I turned it back on and tried to enter Windows just to check if maybe Windows could boot I got this error message:
\boot\BCD error
And even when trying it through Ubuntu, I got this error:
Volume not mounted.
I have a lot of important files stored on the NTFS partition, but it could not be mounted in either Windows or Ubuntu, so I wasn't able to recover any data from it.
I tried to fix the problem through the Windows Repair disk, but it failed. For some reason the installation gets stuck before I can reach CMD, so the solution should probably come from Linux.
Solution 1:
There is a hardware problem with either the hard drive or the laptop, so the hard drive cannot be mounted in either Windows or Ubuntu. If the laptop's hard drive is broken it would cost a lot of money to pay a data recovery specialist to recover the data from it, so before you do that you should try to recover the important files from the hard drive yourself.
It might be easier to recover the data from that hard drive if it was removed and put into a portable hard drive enclosure. They are very cheap, being just a box the same size as a laptop's 2.5" hard drive with a USB port and a USB cable to attach it to another computer. Remove the laptop's hard drive and plug it into the portable hard drive enclosure.
Then take the portable hard drive enclosure to another computer and recover the data with gddrescue and ddrutility data recovery utilities.
sudo apt install gddrescue ddrutility
There might be bad sectors on the hard drive. Bad sectors cannot be fixed. A small number can be worked around, but this is done automatically by the firmware in the hard drive. If there are too many bad sectors the hard drive must be replaced immediately before it becomes impossible to recover the data from the hard drive. To check for bad sectors see the answers to How to run a checkdisk?.
ddrutility is meant to be a compliment to GNU ddrescue (gddrescue on Ubuntu). It is a Linux-based set of utilities to help with data rescue. Find what files are related to the bad sectors using a ddrescue logfile, a special NTFS utility to find files related to bad sectors, create a domain logfile to use with ddrescue to only recover the used portion of an NTFS partition, create a domain logfile to use with ddrescue to focus on recovering the MFT of an NTFS partition and perform some advanced disk read functions.
Another alternative is SystemRescueCD which contains FreeDOS and other rescue and data recovery utilities. SystemRescueCD is lightweight, and it's designed to be easy to boot on old computers. A SystemRescueCD bootable live USB can be created in Ubuntu with the built-in Startup Disk Creator application.
If all of these methods fail to recover the data, you need a tool that can recover data from an NTFS partition that can't be mounted. See the answers to Recovering broken or deleted NTFS partitions.
Solution 2:
After two weeks of trying rescue the partition, I succeed to save all my personal files and photos thanks to Teskdisk! If that happens to someone, you have to do a deep search in testdisk and it can finds the broken partition and then you have access to all files