Last year I was struck with a self inflicted problem when upgrading enterprise versions of Windows 8.1 to Windows 10 on my work PC. Within the machines we have an SSD (256 GB) and HDD (512 GB). The SSD inside the machine was to be upgraded to a larger 512 GB version at the same time.
This is where it got interesting; I had managed to confuse myself in the installation process thinking that the 512 GB HDD was should be a clean drive. You can guess what happened next...
Goodbye files, goodbye projects and goodbye databases.
Realising the instantaneous failure to use my brain, my body felt flushed all over. I pushed on and installed Windows 10 onto the new SSD. Many minutes were spent anxiously hoping that the data remained intact and only the partition map was erased. After completing the installation process, I looked around online to find the best way to recover data from a GPT mapped drive.
In the end it was only a quick format of the drive (deleting the partition location information). Since this was the issue I used testdisk to detect the deleted partitions and restore them.
This article was inspired by an answer I had left on Ask Ubuntu to resolve a similar problem. I'll outline the solution as a step by step guide below:
Assuming your disk drive is located at
/dev/sdb, you can check using
fdisk -l /dev/sdb
testdisk and follow the ons screen process to recover your partitions.
- When asked to create logs, select
- Proceed with selecting
[Analyse]to scan for the deleted partitions.
- This should detect the drives in your PC where you will be able to select the correct disk and
- Just select
[Intel]if you have a MBR disk layout. It will then scan and detect the deleted partitions.
- If you are happy with the layout you can then
[Write]the partition layout to disk.
- Otherwise you can perform a
[Deeper Search]to detect partitions that may have been deleted.