How to undelete a deleted file system.

Hi,

Long story about having an 11.4 installed and trying to install 12.1 on a new partition to allow me time to get 12.1 set up before I migrate to it. It would boot once after the install but then wouldn’t again.

It could would boot to the point of the new splash screen and then tell me it couldn’t find the disk (which it clearly had as it had read boot/grub/menu.list etc). I’d then “update” the new 12.1 partition, run grub again and it would boot once and then wouldn’t again.

So I thought that maybe getting both 11.4 and 12.1 to share the swap space was the problem. So I deleted my new 12.1 partition (using 11.4) to then allow me to create a slightly smaller one leaving 8GB free for a second swap space.

I used fdisk to delete the / filesystem of 12.1. I then ran the install again, went to create to partitions but noticed that the partiton table now had my home file system 50 GB out of alignment. So I guess that when fdisk removed the / it didn’t like the “hole” and moved the notion of /home to fill the hole. But that meant that /home now wasn’t a valid filesystem.

I should have taken notes on the starting and ending block numbers of each partition - but I didn’t.

I deleted the now incorrect /home partition and am running TestDisk’s photorec to recover all files before doing anything else. I have made sure that I haven’t written to any part of the old partition.

R-Studio can find the partition and its superblocks, but it doesn’t tell me exactly where they are.

My question is, how can I find the starting and ending block numbers (the end is easy it was the last partition and so its just the last block on the disk), redefine the partition (with fdisk, Yast2’s Partition tool or other, run fsck.ext4 and get it all back again?

Thanks,

David.

Possibly SystemRescueCd or start – Parted Magic