1

So, my configuration is with 2 separate physical drives. One with Linux one with Windows. Boot selection I am doing from bios (Linux was installed without the windows SSD plugged in). Everything was sugar and nice until I need it to reinstall windows and from Windows 10 installer by mistake I deleted also the SSD with linux. I immediately realized and did nothing over it hoping that there will be a queue of events that will be triggered by a "apply changes to disk" but this was not the case.

Is there any way how I can recover my partition? thank you!

Vlad
  • 353
  • What exactly do you need to recover? Config files, personal files (eg, images, documents, etc.), or all of the above? Can you manage with just recovering your personal files? If so, I've had great experiences with testdisk and photorec. – anonymous2 Apr 12 '18 at 17:11
  • it would be nice to recover the partition... as I know everything is there... it was installed on a small mSATA SDD (32GB) taking the entire space... – Vlad Apr 13 '18 at 20:28
  • There are a few tools you can play around with, like photorec, but my experience (probably around 20-30 recoveries, so anecdotal only) is that there is very little chance of guessing all the parameters right to get the partition entirely recovered. Given that the hard drive is very small, my absolute first step would be to make a disk copy onto backup drive and them play with the copy only. – anonymous2 Apr 13 '18 at 20:34
  • That way, if you mess something up by mistake, you've lost nothing, and if you fix it, you've gained everything. – anonymous2 Apr 13 '18 at 20:35

1 Answers1

2

You may find some help here under the section titled "Lost Partition" https://help.ubuntu.com/community/DataRecovery

Lost Partition

If you made a mistake while partitioning and the partition no longer appears in the partition table, so long as you have not written data in that space, all your data is still there.

GNU Parted

Run Parted from the command line to recover your partition.

When changing the partition table on your hard drive, you must ensure that no partition on the disk is mounted. This includes swap space. The easiest way to accomplish this is to run the live cd. Parted is installed on the base Ubuntu system. Once at the desktop, open a terminal and run_:

sudo swapoff -a

Next run parted and tell it to use the device in question. For example, if your /dev/sda drive is the drive from which you want to recover, run:

sudo parted /dev/sda

Then, use the rescue option:

rescue START END

where Start is the area of the disk where you believe the partition began and END is its end. If parted finds a potential partition, it will ask you if you want to add it to the partition table.

Testdisk

Alternatively, the testdisk application may recover your partition. Use any method to install the testdisk package.

Run testdisk and it will scan your computer for media and offer you a menu-driven way to recover your partition.

sudo testdisk

Gpart

Another program that can scan drives and re-create a partition table based on "guesses" is Gpart. Use any method to install the package gpart.

To scan the first hard disk using default settings type

sudo gpart /dev/sda

or

sudo gpart /dev/hda

depending on your Ubuntu version.

You can restore the "guessed" partition table, only after checking it very carefully (you're strongly advised to write to another device instead), using

sudo gpart -W /dev/sda /dev/sda
Eliah Kagan
  • 117,780
rkeaing
  • 1,584
  • since I wanted (also) to change my distribution I have deleted the partition and installed the OS anew. For learning perspectives I am strongly considering to replicate the environment and to try out the solution. From my previous experience looks like a good way to try. Thanks a lot! – Vlad Apr 20 '18 at 09:12