2

When creating a Clonezilla live USB, I mistakenly entered the wrong device name in the dd command:

sudo dd if=/path/to/clonezilla-iso-file of=/dev/sda status=progress

where sda was the laptop's HDD (I was meaning to type sdb which was the USB drive. :(

Undestandbly, after rebooting I get a "No bootable device found".

I tried re-installing Ubuntu (by creating a new Ubuntu 20.04 bootable USB) and hoping that I could install the OS again while not losing any of the data from my HDD. When I go through the installation process I get a "This computer currently has no detected operating systems" and there is no "Reinstall" option which would potentially allow me to keep my data.

Is there a way to recover/access the data on my HDD (well, at least whatever was not overwritten by the dd command)?

Any help would be most welcome!


Update: Using an Ubuntu 20.04 bootable USB, I selected the "Try Ubuntu" option and on the terminal run sudo gdisk -l /dev/sda which gave the following output:

GPT fdisk (gdisk) version 1.0.5

Caution: invalid main GPT header, but valid backup; regenerating main header from backup!

Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options on the recovery & transformation menu to examine the two tables.

Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: ERROR
Backup partition table: OK

Partition table scan:
    MBR: MBR only
    BSD: not present
    APM: not present
    GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the GPT MAY permit recover of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 
10
  • 3
    Most of your data is probably still there except for portions of the disk that have been physically overwritten by the clonezilla iso. I’m no expert on data recovery but it’s generally recommended to clone the drive and work on that copy. Photorec will recover files that still exist (not just photos) but it doesn’t know the original file name so that can be a slow process to find everything. Don’t touch the original disk and research data recovery.
    – PonJar
    Nov 19, 2021 at 16:14
  • 5
    How large was your ISO file? That amount of data is not recoverable. And it probably overwrote the partition table. Is sda gpt partitioned which has a backup partition table at end of drive? If so, what does this show? sudo gdisk -l /dev/sda or does testdisk show any partitions? and as PonJar suggests best to work from a clone of drive.
    – oldfred
    Nov 19, 2021 at 16:16
  • 2
    You need to boot into a live environment (usb or CD/DVD) to run the gdisk command
    – PonJar
    Nov 19, 2021 at 18:14
  • 2
    If you have good backup, load the backup gpt partition table & see if it matches what you expect. You may be able to then restore gpt table & run repairs. You will not recover the first 306MB of data, nor restore booting, but then may be able to recover data. More repair info use p, v & w to write the partition table. If not correct just use q to quit. : askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table/…
    – oldfred
    Nov 19, 2021 at 19:59
  • 2
    You select 2 per your data posted in question. That should load gpt data. You can always q or quit and nothing should change. You then will probably need to run fsck (e2fsck) on all ext4 partitions. If some other format, not sure which repair tools you may need. askubuntu.com/questions/642504/…
    – oldfred
    Nov 19, 2021 at 20:29

0

You must log in to answer this question.

Browse other questions tagged .