Recovering Ubuntu after filesystem was overwritten using dd

4

I had an Ubuntu installation on my laptop, on an encrypted LVM (this was /dev/sda1).

I was planning to write an Arch Linux image to my USB drive (/dev/sdc1), following this guide - https://wiki.archlinux.org/index.php/USB_Installation_Media#Overwrite_the_USB_drive. Instead, I accidentally overwrote my Ubuntu by using

dd if=archlinux.iso of=/dev/sda

Is there any hope of recovering my Ubuntu installation, or is it totally hopeless, and I rather recover as much data as possible?

NOLFXceptMe

Posted 2011-09-21T15:38:25.487

Reputation: 682

1I think the worst part is that it was an encrypted LVM, I have the feeling trying to recover this is nearly impossible, but lets see what others say. – madmaze – 2011-09-21T15:40:45.927

D: Scary! I did dd if=/dev/sda of=justincase.bkup bs=512 c=1 so I won't mess up my MBR or partition table, or two byte signature. :D – Rob – 2011-09-21T17:29:00.047

Answers

1

I'm assuming this is dm-crypt/ LUKS. How late did you realize this mistake and terminate the dd? If you've overwritten the salt in the header, it's impossible to recover your data. Otherwise, there are some tools in the cryptsetup-luks package to perform surgeries by hand and recover data. For more, see the questions that follow "What happens if I overwrite the start of a LUKS partition or damage the LUKS header or key-slots?" in the official LUKS FAQ.

artagnon

Posted 2011-09-21T15:38:25.487

Reputation: 191

Ah, it's totally hopeless. It doesn't go past the POST screen, nor can I boot from a USB/CD/DVD. I'm guessing it has to do with some EFI/UEFI system. And since the Arch Linux image is about 375 MB, it must've wiped out the boot loader, LUKS header and more. Just handed it over to the Lenovo guys. – NOLFXceptMe – 2011-09-22T07:13:30.190

0

You have no hope whatsoever I am afraid. You could send your HD to some top of the range data recovery company which would charge you a lot and not even grantee that they will get the data off.

Time to restore from backup.

Sardathrion - against SE abuse

Posted 2011-09-21T15:38:25.487

Reputation: 390