Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Erased partitions, how to get back?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
nigratruo
Posts: 22
Joined: 2017-08-12 22:46
Has thanked: 1 time

Erased partitions, how to get back?

#1 Post by nigratruo »

Hi,

I screwed up big time: I tried to install Windows 7 on another HD and got confused which disk I was dealing with. So instead of erasing partitions on the target disk for Windows 7, I destroyed the 2 (or 3) partitions of my Debian 9 install.
Now the two partitions got erased, but the data should still be there and intact. I used the standard Debian 9 install method, so that should be msdos partition type on a 1 TB disk and 2 or 3 partitions: LVM and encrypted and SWAP partition.
Now I have not touched the system yet, as I'm not sure how to proceed here. One idea I had was to "reinstall" Debian 9, but just do the partitioning and do not format anything, as it should partition it exactly the same as I did when I set up the system originally. Luckily, this was not so long ago, so no upgrade or anything happened, it was a fresh install.

Now messing around with the partition tables (creating new ones) should not erase any data on the partitions itself, right?
But the encryption (full system encryption) should make it a little more difficult. I currently don't have enough space to pull a full image with dd_rescue or such and will have to operate on the real disk. But I'm normally a very careful person that thinks first and then acts, so that makes the initial mistake (first one like this in many many years) much the dumber ;-)

Thanks,

Markus

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Erased partitions, how to get back?

#2 Post by dilberts_left_nut »

Testdisk should be able to restore your partitions without much problem.
Your encrypted LVM might be more trouble though - I don’t know much about how that works so definitely do your own research before making any changes to your only cooy of the data - it could all become absolutely unrecoverable very easily.
You could, at a minimum, probably use dd to take a backup of the relevant partition header sectors etc. but again, verify what is the important bits of your encrypted partition.
AdrianTM wrote:There's no hacker in my grandma...

nigratruo
Posts: 22
Joined: 2017-08-12 22:46
Has thanked: 1 time

Re: Erased partitions, how to get back?

#3 Post by nigratruo »

Thanks for the tip, yeah, I myself am not that familiar how the different layers, LVM, LUCKS Filesystem affect restoring a partition table.

Post Reply