[parted-devel] [PATCH] Synchronise MBR tables with GPT
Matthew Garrett
mjg59 at srcf.ucam.org
Mon Mar 5 15:23:19 CET 2007
On Mon, Mar 05, 2007 at 03:01:45PM +0100, Olaf Hering wrote:
> On Fri, Mar 02, Matthew Garrett wrote:
>
> > + if (strncmp (part->fs_type->name, "fat", 3) == 0)
> > + raw_part->OSType = 0x0b;
> > + else if (strncmp (part->fs_type->name, "ntfs", 4) == 0)
> > + raw_part->OSType = 0x07;
> > + else if (strncmp (part->fs_type->name, "hfs", 3) == 0)
> > + raw_part->OSType = 0xaf;
> > + else if (strncmp (part->fs_type->name, "ext3", 4) == 0)
> > + raw_part->OSType = 0x83;
> > + else if (strncmp (part->fs_type->name, "linux-swap", 10) == 0)
> > + raw_part->OSType = 0x82;
> > + else
> > + raw_part->OSType = 0xef;
>
> I have not read the whole file, just this hunk.
> What about RAID, LVM and all the other possible values of ->OSType?
Mm. On this hardware, I don't think it actually matters in any real way,
but this is really a matter of coming up with a good way of mapping GPT
identifiers to MBR ones.
> > + raw_part->StartHead = 0xfe;
> > + raw_part->StartSector = 0xff;
> > + raw_part->StartTrack = 0xff;
> > + raw_part->EndHead = 0xfe;
> > + raw_part->EndSector = 0xff;
> > + raw_part->EndTrack = 0xff;
>
> Have you checked what will stop working if the CHS values are all zero?
> I tend to think that CHS is not used in hardware, since maybe 20 years or more.
The Apple implementation is fine with this. If anyone implements an EFI
BIOS compatibility layer that pays any attention to CHS values at all,
I'll be pretty amazed.
--
Matthew Garrett | mjg59 at srcf.ucam.org
More information about the parted-devel
mailing list