Data Recovery After An Aborted Zero-Fill?

I did something monumentally stupid and started zero-filling the wrong drive this morning. I aborted the process when I realized my mistake. Is there any chance of recovering what hasn’t been overwritten? What’s my best course of action?

Try using testdisk to recover the deleted partition table. The partiton table will have been completely deleted so it wont be easy, but the tool should be able to find the FS inodes on a deep scan (depending on the filesystem used).

Unfortunately, if you ran the zero for long enough, chances are that recreating the partitions wont recover anything unless they start far enough into the disk. This is because the FS journal is likely wiped out, meaning journal based file undelete commands will not work.

That means that you would have to run a tool like photorec that scans the drive block by block for recognizable file-types. This takes a long time and is not very reliable, make sure to mount with read only as to avoid overwriting any data on the drive accidentally.

2 Likes

Initially, it didn’t see the partition, as I expected, but after a deep scan, and a few additional steps (restore boot record?), it gave me the option to restore the mft from mirror. That “succeeded” but it was still saying the file system was damaged and gave me the option to rebuild the mft, which is where I am currently.

before you start writing stuff to disk, I would take a backup image just in case you mess something up. If you have a larger harddrive available, run gnu_ddrescue to backup the image to a larger drive.

1 Like

I think I’ve already written stuff to disk, but I don’t think rebuilding the mft is going to do any more harm than I’ve already managed. If that isn’t successful, I’m going to have to move on to Photorec anyhow, right? I’m also not sure I can stand the anxiety of waiting another day in order to backup the entire 8TB drive. I’d also need to buy myself another 8TB drive.

Perhaps I should just take your advice and be patient though.

In any case, I really appreciate your advice. Just getting a little bit of guidance goes a long way to manage my stress level.

What filesystem was on the disk?

a single NTFS partition

NTFS has a bad habit of putting the backup MFT right next to the primary MFT sometimes. If it can see the backup MFT at all you’re probably fine, but there is a good chance that it won’t.

I realize I think I screwed things up by selecting Intel/PC partition instead of EFI GPT.

that shouldnt matter as long as it can still detect the partition

After rebuilding the MFT, it was still unable to read the files in the partition, and Windows was only seeing a 2TB RAW partition with the rest marked as unallocated, which lead me to believe that the boot record being rewritten as MBR instead of GPT screwed things up. After a few attempts at resolving it, I gave up and just started running Photorec. I have a feeling that the NTFS partition it originally detected was invalid anyhow, as I noticed that it didn’t actually show the label for the partition.

Ah, this is because the drive is so large and that it was originally formatted with GPT

Photo rec seems caught in a loop. It keeps jumping back to a previous sector. Opening the session file in Notepad++, it appears to show all of the sector ranges and then a bunch of NUL characters.

Capture

In the last twelve hours it’s only managed to recover 11 text files. I’m kind of afraid to start over at this point, but I think my next course of action might need to be to start over, select ‘No Partition’ instead of the latest invalid GPT one, and remove all of the file types that I don’t need from the options.

Oh jeez. Tried starting over with ‘No Partition’ and only a select few file formats. Left it running and it started looping generating the same 2KB .ts file over and over to a new file each time, generating over a million files before I stopped it.

Sounds about right