Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Disk Partition Type" check fails, if one drive is MBR formatted [not the main drive] #7

Closed
Aris-t2 opened this issue Jul 3, 2021 · 16 comments
Labels
help wanted Extra attention is needed Hmm... Panic!

Comments

@Aris-t2
Copy link

Aris-t2 commented Jul 3, 2021

Hi,
thanks for this nice tool.

I came across a small issue. One non-GPT formatted drive causes the whole "Disk Partition Type" check to fail.

There are 4 SSDs inside my PC and one is indeed MBR formatted, but it is not the main drive, so ReadySunValley should not even check that, should it? From my understanding Win 11 check tools should only check the main drive (the one Windows is running on) or am I wrong?

  1. Samsung SSD 970 Pro 1TB M2 (GPT formatted) [Win 10 / drive C]
  2. Samsung SSD 960 EVO 1TB SATA (GPT formatted)
  3. Samsung SSD 960 EVO 1TB SATA (GPT formatted)
  4. Samsung SSD 840 Pro 128GB SATA (MBR formatted)

image

@Belim
Copy link
Member

Belim commented Jul 3, 2021

hi,
curious about this one. it should only look for active/boot partitions

Can you check this
ReadySunValley_x64.zip

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 3, 2021

I forgot to tell the MBR one is also a boot partition with an alternative Win 10 OS/setup used as a backup, but it is not the active one.

Same result as before:
image

@Belim
Copy link
Member

Belim commented Jul 3, 2021

I assume your system disk has not the index 0 ?

So my assumption about the wmi bootpartition property usage is incorrect for cases when bootmanager is on another disk. I thought the OS uses the active partition (with index 0) when booting from a hard disk.

Hmm, i dont know how WMI could now tell me which one is the active partition 🤔

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 3, 2021

You are right, the current system disk has index 3, while the "old" backup disk with MBR has index 0.
So the check for index 0 causes the issue.

Actually there is no classic boot manager on any drive, since I temporarily removed the SATAs when I installed the OS on on the M2. When needed I use the UEFI/BIOS/motherboard boot manager.

@Belim Belim added help wanted Extra attention is needed Hmm... Panic! labels Jul 3, 2021
@Belim
Copy link
Member

Belim commented Jul 10, 2021

Can you check this
ReadySunValley_x64.zip ?
Please check also the "List all" linklabel and tell me whether all partitions has been detected

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 10, 2021

Sure, thanks for looking into this. Current result:

image

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 10, 2021

I'm not sure there is a way to change the disk index of a drive, but I think the test/check can always return valid, if the drive the system is on offers GPT.

Something like this (sorry for the pseudo code, but I think you get my idea):

var result_system_gpt = false;

for(i=0;i<=DiskIndex.length-1;i++) {
  for(j=0;j<=PartitionIndex.length-1;j++) {
    if (DiskIndex[i].PartitionIndex[j].GPT=="System")
      result_system_gpt = true;
      return;
  }
}

@Belim
Copy link
Member

Belim commented Jul 10, 2021

if the drive the system is on offers GPT. Something like this (sorry for the pseudo code, but I think you get my idea):

do it exactly like this but it does not work 😁

now it only checks for Bootpartition and GPT occurrences. Can you check this
ReadySunValley_x64.zip

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 10, 2021

image

@Belim
Copy link
Member

Belim commented Jul 10, 2021

another attempt
ReadySunValley_x64.zip

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 10, 2021

Thanks for looking into this.

image

@Belim
Copy link
Member

Belim commented Jul 10, 2021

damn, thats not possible. it loops through all partitions and stops at the first one that offers gpt support. I have tested on two systems and it works here

Samsung SSD 970 Pro 1TB M2 (GPT formatted) [Win 10 / drive C]

does this disk have index 3 and is also the boot partition?

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 10, 2021

Looks like converting my SSD using mbr2gpt back then created a weird result, maybe even too much partitions?
Disk index 3 has four partitions.

According to the above screenshot the system is on partition 3, but looking into "disk management utility" (not sure, what the exact name is on English OS), tells the system is on partition 2. Anyway the system partition is also the boot partition, called "Startpartition" in the screenshot below.

image

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 11, 2021

Looks like this can be closed now. Good job.

image

@Belim
Copy link
Member

Belim commented Jul 11, 2021

hooray! ich nehme an, der screen ist mit dem gestrigen release 0.30 geschossen... die ersten beiden sind mbr formattiert und deine systempartition mit index3 wird richtig erkannt!?

aus der wmi funktion werde ich aber nicht schlau. sowohl die suche nach "System" als auch "BootPartition=True" habe ich weggelassen und es scheint wohl richtig zu funkt.

eine schwere geburt, aber danke für die unterstützung 😁

@Aris-t2
Copy link
Author

Aris-t2 commented Jul 11, 2021

True, that was a hard nut to crack. :-)

I'm glad I could help.

@Aris-t2 Aris-t2 closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Hmm... Panic!
Development

No branches or pull requests

2 participants