0

I was trying to burn an iso image to a DVD with the command:

sudo dd if=/path/to/iso.iso of=/dev/sdb bs=1024k status=progress

However, I ended up overwriting about 1.4 GB on my USB drive which had important data on it before I killed the process with Ctrl+C! I had like 10 GB of data on the drive, so it's not all gone. I tried to recover the data with testdisk, but I can't find the data. I know that PhotoRec could recover photos and videos from my USB drive, but I also had .odt, .docx, .pptx and many other types of files. I also had my encrypted diary on the USB drive (with its private key).

Is there any way I could recover the data? I know that the USB drive was formatted with NTFS.

P.S. After this, I corrected the command to:

sudo dd if=/path/to/iso.iso of=/dev/sr0 bs=1024k status=progress

This command returned an error message saying the /dev/sr0 is read-only despite that the DVD was completely blank and not used before.

5
  • 1
    Long time since I used it, but TestDisk and PhotoRec were the two main ones recommended to me back in the day. If you have access to a windows machine, "Recuva" from ccleaner.com is another free option. Use "Deep Scan", and "Non-deleted files" in settings for the most thorough search.
    – Stax
    Commented Jun 6, 2022 at 1:49
  • overwritten data is almost always unrecoverable. stellarinfo.com/blog/… Data recovery software relies on the way filesystems are used (in that generally new data is written to a new location, leaving the prior data intact on disk), but dd executes below the filesystem level, so it will overwrite any data in the blocks it is operating upon without knowledge of or regard for what is already there. Commented Jun 6, 2022 at 3:24
  • 1
    Welcome to Super User. (1) Please take our short tour to see how the site is designed to work. What you observed with /dev/sr0 is a separate "problem". There should be one problem per question. (2) Your question may be closed as a duplicate of this one, because photorec and similar programs are usually the best one can do at home. (3) One can straightforwardly read from sr0, but writing is more complicated. To burn a DVD you still need a dedicated program, e.g. cdrecord. Commented Jun 6, 2022 at 5:18
  • It still saddens me that people don't have backups. Entrust your entire life to a single device that could be dropped in a puddle, left on a bus, run over by a car, zapped by a power spike… "Any data not stored in at least three distinct locations ought to be considered temporary".
    – Tetsujin
    Commented Jun 6, 2022 at 8:40
  • It's a misnomer that photorec is only for media files, as it's purpose is to search for and recover file types based on extension and supports >100 extensions
    – JW0914
    Commented Jun 7, 2022 at 9:41

1 Answer 1

0

First, you can try to create a binary file from your USB drive:

dd of=~/myusb.bin if=/dev/sdb bs=4M (of course replace /dev/sdb with your USB device path)

Then I recommend you to try binary forensics tools, which detect file headers to recover whole files, like:

3
  • 2
    if= of= swapped
    – Tom Yan
    Commented Jun 6, 2022 at 10:17
  • Thanks! It was important :) Edited Commented Jun 7, 2022 at 9:26
  • 1
    IMPORTANT: "if" means input file (your USB stick location) and of = output file (the file it'll make on your computer). Triple check the command before running, or else your entire recovery is shot.
    – Fusseldieb
    Commented Nov 21, 2023 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .