Background
I erased one of my partitions recently which was mounted on my /home path in Ubuntu Linux. However I was able to restore the partition back and life was back to normal.
I was trying to install Windows and the installer (from USB) was forcing UEFI mode instead of Legacy. So the NTFS partition did not work out and Windows could not be installed since partition was of type MBR instead of GPT (which is required by UEFI mode). So when I tried to make it GPT it started erasing entire disk instead of the disk partition I had selected. I stopped the process immediately but my partitions were gone and it was one disk without any partitions. As I mentioned earlier I was able to restore my previous partitions and data was intact.
In this post I will show you how we can do this.
Boot your machine from this USB drive.
NOTE : If you do not have a bootable USB you can create one using unetbootin.
Setup
You need to have a bootable USB with Ubuntu or gparted. Gparted has both tools -
- gparted and
- testdisk
Boot your machine from this USB drive.
NOTE : If you do not have a bootable USB you can create one using unetbootin.
How to restore a corrupted or deleted partition with TestDisk and Ubuntu Live
After you boot from Ubuntu live USB go to "Software and Updates" and under Downloadable from internet select the entry with "Universe".
Now run -
- sudo apt-get update
- sudo apt-get install gparted
- sudo apt-get install testdisk
Open gparted to see your disks and partitions. If the partition is missing you should see an unallocated partition. Now run testdisk -
- sudo testdisk
- Select "No Log" option.
- Select the disk drive you want to recover, e.g. /dev/sdc.
- Select your partition table type. Usually it's Intel.
- Select "Analyse" and then "Quick Search".
- Your drive will be analysed and you will see a list of all found partitions. Press Enter.
- On the next screen you have the option to either perform a second Deeper Search, or Write the current partition table to disk. If the quick search was successful, choose Write.
- Finally reboot your machine to see the reflected changes
- You can resuse the gaprted to see that the partition is restored post reboot
Screenshots
That's it. Your partitions should be restored.
Related Links
- Make a bootable flash drive from an ISO image on Ubuntu(OSFG)
- How can I install Windows after I've installed Ubuntu?(SO)
No comments:
Post a Comment