Recovering Ubuntu after filesystem was overwritten using dd
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?
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.