Page 1 of 1

wrong deletion of sda1 in partition editor in live OS-advice needed

Posted: 16 Aug 2016, 06:16
by ysimulac
I am using Porteus 3.x with the OS loaded in RAM and swap files located on one of the mounted flashdrives. I meant to format a partition in sdd1-- a partition within one flash drive where no OS or SWAP is located. Two HDD partitions were automatically mounted upon OS boot, sda1, and sda5, I accidentally deleted sda1 (~85GB) in partition editor due to inattentiveness.

sda1 was only mounted (I believe) by some sort of default Porteus boot setting, (boot code scanned sda1 for "porteus-v3.1-i486.sgn").
During this current boot, the necessary .sgn file for boot was previously copied into sdc1 porteus boot folder, and appears to have been loaded from sdc1-- the porteus flashdrive.

sda1-- was-- my main partition for Ubuntu running when HDD booted first from BIOS, not USB boot. The sda1 filesystem was (either ext2,3, or 4), I'm gonna look through this session's boot log to hopefully see.
Sda5, the second automounted, and only other sda partition detected by porteus was (I think) previously used as additional cache space during the live OS operation.

As it stands RIGHT NOW, the HDD is not spinning because I unmounted sda1 (accidentally) and deleted it (idiotically). When I discovered this--immediately, I unmounted sda5, as it is unneeded, to prevent HDD from spinning at all, (I was still messing with porteus to figure out how it can not auto mount both sda1, sda5-- basically the whole internal HDD).

I got testdisk_static to load in a root console, without making it a module (porteus specific) and importantly Without Rebooting. I have an external usb hard drive which I can mount, I have freedom to create partition within that external hdd. What is my most effective way to recover as much of the sda1 partition in as much of the original file structure it was in?

I just exported the partition table for sda after sda1 became allocated space. There might be somewhere available partition table of sda before the mistake. I'm gonna eat, and hit the forums to continue my research for recovery attempt, I'm gonna try to not reboot the live OS. By my understanding, since the deleted partition has not had any or almost any overwrites, and I unmounted the rest of the HDD, I have a chance at recovering the files and directory structure. Any direct advice or thread links are much appreciated, I'll be on here researching myself.

Re: wrong deletion of sda1 in partition editor in live OS-advice needed

Posted: 17 Aug 2016, 19:42
by cgrenier
As you have deleted the partition, you should be able to recover using testdisk, Analyse, Quick Search.
Set the partition as *(bootable). Do not forget about sda5, it should be listed as L(ogical).
On next screen if both partitions are listed, choose Write, confirm, Quit