testdisk [&W10] thinks an MBR partition is GPT - what would be the result of repairing it?

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
Johnson
Posts: 3
Joined: 15 Apr 2020, 16:25

testdisk [&W10] thinks an MBR partition is GPT - what would be the result of repairing it?

#1 Post by Johnson »

I made a stupid mistake. I accidentally converted an MBR SSD to GPT.
The MBR SSD had two NTFS partitions (and some blank overprovisioned space): one active with W7-64 on it & the other data.
Unsurprisingly, W7 would no longer boot.

So, I took the SSD out, put it in an external enclosure and connected it to another computer.
There I used the same tool to convert the disk back to MBR.
(I had not yet heard of testdisk at this point)
Then I used partition wizard first to recover the partitions, and then to rebuild the MBR.
Then I ran chkdsk to attempt to fix the disk.
I could read files on the disk again.
So I put the disk back in and tried to boot. Did not work.
Exploring many things I discovered in diskpart that the partitions were marked as hidden. So I removed that attribute.

At this point W7 would boot again. (probably I was pretty lucky)


However - in this a system I have another SSD on which I have installed W10. (I unplugged all other drives when I installed W10)
When I am in W7, I can see and access the W10 GPT SSD.
When I am in W10, I can see but cannot access the W7 MBR SSD. (originally I could, but not since this gaffe)
In W10 the W7 SSD is online, but the partitions are marked as offline.
When in W10 I use diskpart and issue the "online volume" command, diskpart says that it cannot online the volume.
But it does not say why, or how to fix it.

After some more poking around I found that the partition type field was set incorrectly for one of the partitions, not to 07-NTFS but to 06-FAT16. So I corrected that as well. Did not help.

In partition wizard in W10 again, I found that if I would hide each of the 2 W7 SSD partitions and then unhide them, they would become accessible again. Great! That is, until I reboot W10, then they go back to being inaccessible.
(BTW, I ran chkdsk on the W7 SSD partitions from both W7 and W10 and they come through clean now)


A long intro (sorry) but ... it was at this point that I discovered testdisk.
So I downloaded it and fired it up. When it gets to the point of showing what kind of partition table it has found on the W7 SSD, it says EFI GPT!!
Now that is interesting.
So the type of partition table is probably marked incorrectly (my guess).
W7 seems to be able to boot and run fine with the partition type marked incorrectly, but W10 seems to pay attention to it and mark the 2 partitions as RAW.

I stopped testdisk at this point.

My question is: what would happen if I instead I tell testdisk that it is an Intel [by which I suppose is meant MBR] disk, and presumably (I have not got that far yet) allow it to repair it?
Will that work, or will I still ruin my disk and make the OS & files completely inaccessible?

Thank you in advance

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: testdisk [&W10] thinks an MBR partition is GPT - what would be the result of repairing it?

#2 Post by cgrenier »

If you rewrite the partition table using TestDisk with PC Intel selected, it will remove the EFI GPT signature.
Be careful to only rewrite the partition table if all your partitions are listed.

Johnson
Posts: 3
Joined: 15 Apr 2020, 16:25

Re: testdisk [&W10] thinks an MBR partition is GPT - what would be the result of repairing it?

#3 Post by Johnson »

One thing that I found recommended somewhere was, using partition wizard, to try to extend or shrink the partitions, even if only a little bit. This would cause it to write an updated partition table to disk, which could fix a mixed up disk. So I did this, using both W7 disk management, and again using partition wizard. It did not change anything. This is quite puzzling.

Thinking about it further, I seem to remember that in W10, the W7 SSD was being labeled as MBR, not GPT as I had earlier guessed and written above. So I went back into W10 to check and sure enough, it does consider the W7 SSD to be an MBR disk. Also, partition wizard thinks that it is an MBR disk.

So this is interesting that testdisk thinks that the same disk is an EFI GPT disk. How could this be? Would they not use the same field to determine this?
I mean I don't know anything about the specifics of these partition systems, but wouldn't there be a field somewhere which would indicate what kind of partition system it is? So how does testdisk come to a different conclusion than W10 and partition wizard?

Johnson
Posts: 3
Joined: 15 Apr 2020, 16:25

Re: testdisk [&W10] thinks an MBR partition is GPT - what would be the result of repairing it?

#4 Post by Johnson »

Ok, here is what happened.
Testdisk found 2 partitions on the MBR W7 SSD, the Active System partition of 102 GB and the other data partition, which was Primary but not active. However, the size of the second partition was not correct. That partition was actually 112 GB, and testdisk thought that it was approximately half that size. Since I had only about 20GB of data on that partition, I thought it would probably be ok.
So I gave the command to write the partition table.
The result is that the Active System partition was ok (I can still boot into W7), but the data partition was split in two by testdisk -- the data partition (55.9 GB) and some unallocated space (56.1GB). Further, the data partition is corrupted and unreadable.
Meanwhile, the original problem, that W10 does not recognize the W7 SSD properly, is unchanged.
So testdisk did not solve the initial problem, and it corrupted the data partition.

When I run chkdsk on the corrupted partition, it says:
The type of file system is NTFS.
Unable to determine volume version and state . CHKDSK aborted.

Is there some way to recover this data partition, or am I going to have to reformat it?

Locked