[parted-devel] [PATCH] Synchronise MBR tables with GPT

Olaf Hering olh at suse.de
Mon Mar 5 15:01:45 CET 2007


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?

> +	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.



More information about the parted-devel mailing list