[Parted-maintainers] Bug#441033: parted does not undestand GPT/MBR hybrid

Osamu Aoki osamu at debian.org
Thu Oct 30 14:24:17 GMT 2008


Hi,

Excuse me.  I took a look at more carefully...

As for the original bug reporter's complain that "partition type of linux
is wong" is correct.  As I use gptsync
osamu at snoopy:~$ sudo gptsync /dev/sda

Current GPT partition table:
 #      Start LBA      End LBA  Type
 1             40       409639  EFI System (FAT)
 2         409640     33701927  Mac OS X HFS+
 3       33964072    100810791  EFI System (FAT)
 4      101072936    134365223  EFI System (FAT)
 5      134627368    142753831  EFI System (FAT)
 6      143015976    147210279  Basic Data
 7      147210280    156301447  Linux Swap

Current MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1       409639  ee  EFI Protective
 2         409640     33701927  af  Mac OS X HFS+
 3 *     33964072    100810791  83  Linux
 4      101072936    134365223  83  Linux

Status: Tables are synchronized, no need to sync.

As I check gptsync source and http://en.wikipedia.org/wiki/GUID_Partition_Table

 "Partition type GUID"                   gptsync
 C12A7328-F81F-11D2-BA4B-00A0C93EC93B   "EFI System (FAT)"
 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7   "Basic Data" <<< This is for linux/windows data

As I see parted source for gpt.c, it looks right

#define PARTITION_BASIC_DATA_GUID \
    ((efi_guid_t) { PED_CPU_TO_LE32 (0xEBD0A0A2), PED_CPU_TO_LE16 (0xB9E5), \
                    PED_CPU_TO_LE16 (0x4433), 0x87, 0xC0, \

Then I realized what OP meant by msftres.

But following looks strange:
        if (fs_type) {
                if (strncmp (fs_type->name, "fat", 3) == 0
                    || strcmp (fs_type->name, "ntfs") == 0) {
                        gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID;
                        return 1;
                }
...
                        gpt_part_data->type = PARTITION_BASIC_DATA_GUID;

Also I am not sure why there is no ext2/ext3.  If it is designed to pass this section, then 
gpt_part_data->type = PARTITION_BASIC_DATA_GUID;???  So parted should
set ext2/et3 to EBD0A0A2-B9E5-4433-87C0-68B6B72699C7   "Basic Data"
instead.  There is something funny...

Cheers,

Osamu





More information about the Parted-maintainers mailing list