Ubuntu – How to save the data in the HDD from a Ubuntu Flash Disk

data-recoveryhard drivepartitioning

It's already some time that my HP250G3 computer didn't want to start up, so I installed Ubuntu 16.04 LTS on my flash disk to recover some data before resetting the hard disk (hard reset + reinstall of windows 8.1).
Then I found out that my HDD is in a giant mess. When I open the terminal and enter sudo fdisk -lu /dev/sda it shows me this:


And when I type sudo parted -l I get this:

Model: ATA ST750LM022 HN-M7 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0.000  750GB  750GB  ntfs

The only problem with this is that my hard disk had around 500GB memory, not 1800GB. So I decided to check what Disks say:


And here is what GParted says:


Now, what can I do to save at least the most important data (~200MB)? Can I solve this by resizing the partitions? It's crucial for me, so please help.

I'll give any missing information.

Best Answer

my hard disk had around 500GB memory, not 1800GB

I am not sure where you got those numbers from, but the size of your hard drive is 750 GB.

what can I do to save at least the most important data (~200MB)?

You probably just need to recover the partition table. Most likely, the file system is not corrupted and you only have to tell the system how to find it.

However, it might also be that the file system is corrupted. I will discuss both alternatives.

Can I solve this by resizing the partitions?

No, absolutely not. Do not attempt to mess up the partitions before restoring the data.

If The File System is Fine

While your question is about NTFS and this one was about exFAT, my answer still applies. I've adapted the instructions to your specific scenario.

The point is to connect an external hard drive where you will copy your files. Install TestDisk and run it on the device:

sudo apt install testdisk
sudo testdisk /dev/sda

If you cannot install it, open the Software & Updates program and verify that all repositories are activated. Some of them may not be by default.

As I wrote in this answer on the Unix & Linux Stack Exchange website:

The essential steps are:

  • scanning the drive
  • selecting the partition
  • pressing P to show the files
  • copying the files with C

If pressing P results in an error message, then the file system is corrupted.

If The File System is Corrupted

Disclaimer: I am the developer of RecuperaBit.

If the file system is corrupted you need to use a program able to perform forensic file system reconstruction. I actually wrote one for NTFS which is called RecuperaBit.

Briefly, the steps would be:

  • clone the drive (/dev/sda) to an image file (optional, but highly recommended)
  • run RecuperaBit either on the drive (/dev/sda) or on the bitstream copy
  • type recoverable at the RecuperaBit prompt
  • recover all files with the following commands (replace [X] with the partition number found in the previous step):

    restore [X] 5
    restore [X] -1

I provided detailed guidance with an example in this answer.

Related Question