chenall/grub4dos

grub4efi 2022-11-28 PARTTYPE issue?

steve6375 opened this issue · 8 comments

If hd1 does not exist, then parttype returns 0x07

image

Has been repaired.
BOOTX64.rar.txt

parttype does not return 0x00 if partition type is 0

e.g. parttype (hd0,3)
where ptn 4 is unused - does not return any text output

grub4dos (legacy) does return 0x00

parttype (0,3) ;; set rt=%@RetVal% ;; echo %rt%

image

Parttype returns incorrect values for GPT MBR

Does not output 0x00 for type 0 partition

2023-05-20 ,which was compiled with ubuntu20.4,
it seemed the result is right?

2023-05-07,the result is right,too.
(hd3,0) (hd3,1) is GPT partition

GPT-TEST-2023-05-23-18-41-06
Which version do you test?

parttype command should only return the partition type numbers of the 4 Protective MBR partition tables in LBA0.
parttype and partnew are only for mbr sector LBA0 use.

So in my example (and yours) only the first partition table entry is EE - all the other 3 table entries are 0.

Some disks have more than one partition table entry in the protective MBR. e.g. Hybrid MBR.
Using parttype, how could you tell if the second partition table in protective MBR of a hybrid disk was used and what type was in it? User may want to create hybrid MBR using partnew and check each of the 4 primary tables in Protective MBR.

image
image

An EE type in any one of the four tables indicated a GPT disk (or hybrid GPT).

image
image

here you see partition type is 7 but EE is reported !

Oh,there is really wrong report for partnew in GPT partition.I found it,too。
GPT partition will show 0xEE,but it should be 0x07(NTFS) or 0x0C(FAT32)

But partnew only can be used for MBR partition now.

Hybird MBR seems only exist in MAC PC?It's too complicated.