Home Blog Projects

Back

Recovering lost files

May 23, 2024

Few weeks ago, I was trying to find a file - very old file. I have a bad habit of not backing up my files, except I know [I REALLY NEED TO BACK THIS ONE UP]

I found TestDisk, a tool that can be used to recover lost partitions and potentially revive non-bootable disks.

You can check it out here:

$ ~ TestDisk

I’m not a big expert of using testDisk, I’m just showing you how I used it to recover files that I had forgotten about.

If you use Linux, you can install testdisk using

 $ sudo apt install testdisk

I’m on a MacOS so I’m just going to use homebrew

 $ brew install testdisk

disk

Above is the list of disks connected to my machine.

After successful installation, to use TestDisk
You type the testdisk command into your terminal.

Run testdisk as root sudo so you can get access to view the connected disks

  $ sudo testdisk

first_step

I really don’t need to record what I’m doing so I would go with the NO LOG option

second_step

It’s showing the available disks on my machine; most are just logical partitions.
We need to identify the external disk but this isn’t really giving us a proper identifier.

We can find out by using the diskutil command

   $ diskutil list

third_step

So, the last disk here is labeled external. 492GB $ disk6

Go to the previous image before this, we can see our disk6 there as well

fourth_step

This is a notification basically letting us know we don’t have write access to this disk and can only read it’s content.
Continue!

fifth_step

It would automatically detect the partition table type, proceed with that.

sixt_step

Here, we can see the various activities that we can perfom on the disk.

seventh_step

Here, it shows the available partition. Click on quick search ( might take a while )

eighth_step

This confirms that this is the only available partition

ninth_step

Select STOP and proceed with that partition.

tenth_step

Here you can see all my files!

eleventh_step

The files in RED : are files that were deleted previously or otherwise problematic

The files in white : are files that are fine and directly accessible

When you move to your desired file, to recover it : use the c key.

It moves you to a different directory on your machine to paste the copied files

twelve_step

You can use the arrow keys to go in and out of the directories

As Instructed, use the C key when the destination is correct

You should see this

thirteenth_step

fourteenth_step

You can check the directory you selected for your file

final

© Ikotun Collins.