dd Mayhem Part 2 – Recovering my Hard Drives Content

This is a continuation of my previous post dd-mayhem – How I Overwrote my Linux Install. This is the post where I attempt to recover my hard drive data. I am writing this post as I go throughout this process with the help of @hbelusca and @oldman on the ReactOS chat.

This is a continuation of my previous post dd-mayhem – How I Overwrote my Linux Install. This is the post where I attempt to recover my hard drive data. I am writing this post as I go throughout this process with the help of @hbelusca and @oldman on the ReactOS chat.

My tools of choice

I am going into this recovery using the following tools:

  • Archlinux Live cd to run my tools from
  • dd to backup my disk beforehand.
  • TestDisk as my recovery tool of choice (suggested my @oldman)

Getting started

!Warning! The dd command is uses here. Please double check the command before using. !Warning!

Before I go playing around with testdisk, I decided to make a backup of my disk by running dd if=/dev/sda of=/mnt/hd.img where /dev/sda is my internal hard drive, verifiable with fdisk -l and /mnt is the mount point of a external USB drive that I freshly formatted beforehand. I also instaled testdisk with pacman -Sy testdisk

Doing the recovery

After doing the backup it is now time to start TestDisk. I started TestDisk by running testdisk, selected my drive, select Intel on the next screen (I am using MBR partitioning and that is what the docs said to use), started a quick scan, then selected the option to do a deep scan. Doing a deep scan found at least 20 possible partitions. It said it couldn’t recover most of the partitions (which were probally overwritten and too old to matter anyways. I selected ok, and got a list of partitions. Pressing p for each partition gives me a list of files that I can browse through. Press q to go back to the partition list (it sometimes took me back the the main menu). I am now ready to decide what partitions need to be restored.

After reviewing the files in the partitions, I am now able to make a decision on what partition to restore.

Time to get more help

After getting annoyed with pressing the wrong keys to many times and having to restart umpteen times, I am ready to ask someone else to help me.

If you have any thoughts, or any suggestions, please reply in the comments below.

dd Mayhem – How I Overwrote my Linux Install

If you have used the linux command line, you may have used dd to write disk images to disk. And if you have used dd, you may have heard the joke that dd means disk destroyer. You may find the joke funny, at least until you have set of to the wrong block device. Here is the story of how I learned what dd can do.

If you have used the linux command line, you may have used dd to write disk images to disk. And if you have used dd, you may have heard the joke that dd means disk destroyer. You may find the joke funny, at least until you have set of to the wrong block device. Here is the story of how I learned what dd can do.

The day was December 23, 2020. Just two days before Christmas. I had previously compiled a PR for ReactOS to test it, copied it to my Raspberry Pi 4b, and configured it to share the .iso file as a mass storage device over the USB port. After rebooting and choosing USB as my boot device, it loaded the drivers and went to a black screen which didn’t supprise me.

Booting ReactOS from my Raspberry Pi 4 in mass storage mode.

After trying a few times, I decided to try a more common method, use a physical USB drive. That is where my mistake came in. I verified that /dev/sdb was my USB drive with fdisk -l, formatting it with parted, I was ready to write my .iso file to my drive with dd. I ran the command sudo dd if=bootcd.iso of=/dev/sda. And there goes the first couple megabytes of data on my hard drive. That’s right, I overwrote the boot sector, boot partition, and who knows what else on my hard drive. Woopse. Look for part 2 where I will attempt to recover the data on my drive.

Design a site like this with WordPress.com
Get started