Writing your own partition recovery

I understand that the question I ask is not simple: "Oh, it is easy! Do it simply and so, and voila!" The fact is, without thinking one night, I deleted the wrong section. I tried several Windows and Linux tools (Partition Disk Doctor, Easeus, Test disk, etc.), but none of them worked. And I think this is because of how I deleted the partition.

I wrote my own boot sector creators / backup tools in C ++ before, as well as one or two kernels in C and Assembler (albeit rather useless kernels ...), so I think I have sufficient knowledge on at least TRY to restore it manually.

My disk was configured as follows:

Size: 1.82TB part0 100MB (redundant windows recovery partition) part1 ~1760MB (my data partition) 

How I broke it:

In Windows 7, I deleted the first partition. Then I expanded the second to take up the first free space, which meant that I still had 2 partitions, which now act as one dynamic partition. I rebooted into my Ubuntu OS and realized that I could no longer read it. I rebooted into Windows, deleted the first partition, then thought, wait ... I shouldn't have done that. Needless to say, now he's dead.

I would like some tips / good links on where to start, what not to do, and what should not be expected. I hope that if the logs are not corrupted yet, I can recover the drive.

Edit:
This is an NTFS drive. After posting this question, I was wondering: given that I know the approximate location of the place where my section was, is there any way to easily identify the logs? Perhaps I can independently recover some of the other information about the disk / partition and write it to disk.

+8
c ++ c assembly data-recovery partitioning
source share
1 answer

The first step, in my opinion, is to find out exactly how these “dynamic partitions”, as you call them, work in Windows 7. From your description, it sounds like you created a kind of logical volume from two physical partitions. I assume that the second section now contains some kind of title for this volume, so recovery tools unfamiliar with this format do not work.

If you find out which windows 7 were made precisely when combining the two partitions, you should be able to record an application that retrieves the image of the logical volume.

Or you can check out NTFS-3G, the FUSE NTFS implementation at http://www.tuxera.com/community/ntfs-3g-download/ . Having studied this code, I am sure that you can find a way to find the NTFS file system on your disk. After that, try to extract everything from the beginning of the file system to the end of the disk into the image and run some ntfs file system check on it. With little luck, you will return the moutable file system.

If you are interested in how to access the drive, just open the corresponding device in Linux, as if it were a regular file. You may need to align your reads with 512 bytes (or regardless of the size of your disk sector: 512 and less than 4096 are common values), otherwise read () may return an error.

+1
source share

All Articles