On 14.07.2021 03:12, Andrea Neroni wrote:
Hi all,

While preparing a bootable USB a wild dd command was executed on the wrong partition, namely on /dev/sda5 instead of the intended /dev/sdb. The consequences are easy to imagine. However, as the start of the disk has not been touched (the command run on sda5) I still have some hope to be able to recover part of the data before wiping out the disk and reinstalling (the overwritten portion of the disk is very small).

Running fdisk on /dev/sda yields the following:

> fdisk -l /dev/sda
Disk /dev/sda: 596.17 GiB, 640135028736 bytes, 1250263728 sectors
Disk model: SAMSUNG HM641JI
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3d27ec68

Device     Boot   Start        End Sectors   Size Id Type
/dev/sda1  *       2048    1050623 1048576   512M  b W95 FAT32
/dev/sda2       1052670 1250263039 1249210370 595.7G  5 Extended
/dev/sda5       1052672 1250263039 1249210368 595.7G 83 Linux


The partition table should be intact, sda5 is a partition inside the extended sda2. The partition should be Ext4.

Question: having those information, is it possible to repair the partition to a state where I can copy away as much data I can and how can I do it?

Thanks to everybody!


Andrea

PS: yes, I know, data should have been backed up. Lesson learned.

In your case, I recommend to try R-Studio Linux. [1]
It is a complex professional data recovery utility, which could take some time to learn how to use it, but it is powerful enough to get the job done.
This version is free and supports only Ext2\3\4 filesystems.

Recovery procedure basically should go like this:
0. Don't write anything to a damaged partition to ensure better yield of recovered data. 1. Make with the utility an image of damaged partition to another physical disk. 2. Use the utility to scan image for filesystems. It could find more signatures, but the right one is usually that makes sense in size the most.
3. Perform low-level scan of chosen filesystem for available files.
4. Open list of found files and select ones you need to recover.


[1] https://www.r-studio.com/free-linux-recovery/

--
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀

Reply via email to