LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Partition codes for GPT (https://www.linuxquestions.org/questions/linux-general-1/partition-codes-for-gpt-865555/)

Skaperen 02-28-2011 02:46 PM

Partition codes for GPT
 
Anyone know why Linux has to share a partition type code (specifically, 0700) with Windows? Why can't it have its own like some other OSes?

mostlyharmless 02-28-2011 03:00 PM

Because it uses the same partition type, which is pretty handy for dual booters. It's nice to be unique, but compatibility is nice too.

Skaperen 02-28-2011 03:32 PM

Quote:

Originally Posted by mostlyharmless (Post 4274329)
Because it uses the same partition type, which is pretty handy for dual booters. It's nice to be unique, but compatibility is nice too.

How does that apply to a dual boot? Wouldn't you want to have one partition be Linux and the other be Windows (if that's the two you have)? Or is this all about trying to use the same one partition for both?

If I had Windows, I'd rather keep it distinct from Linux, with a type code to keep them apart. Linux swap does have its own type code. By why does a Linux filesystem (usually ext2, ext3, or ext4) and a Windows filesystem (usually, FAT32 or later) need to be made hard to tell them apart? Wouldn't that risk Windows thinking it owns even the one intended for Linux?

jefro 02-28-2011 06:52 PM

From wiki.
"
In computer hardware, GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. Although it forms a part of the Extensible Firmware Interface (EFI) standard (Intel's proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of MBR partition tables, which restrict a disk partition's size to a maximum of 2.19 TB (2.19 × 1012 bytes) or 2 TiB−512 bytes (2,199,023,255,040 bytes or 4,294,967,295 (232−1) sectors × 512 (29) bytes per sector).[1] GPT allows for a maximum disk and partition size of 9.4 ZB (9.4 × 1021 bytes) or 8 ZiB−512 bytes (9,444,732,965,739,290,426,880 bytes or 18,446,744,073,709,551,615 (264−1) sectors × 512 (29) bytes per sector).
"
From man page gdisk.
"
If Windows is to boot from a GPT disk, a partition of type Microsoft Reserved (gdisk internal code 0x0C01) is recommended. This partition should be about 128 MiB in size. It ordinarily follows the EFI System Partition and immediately precedes the Windows data partitions
"


You can see that GPT is a standard in use because of either limitations or by a need rather than an OS driven issue.

Skaperen 03-10-2011 06:52 PM

Quote:

Originally Posted by jefro (Post 4274561)
From wiki.
"
In computer hardware, GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. Although it forms a part of the Extensible Firmware Interface (EFI) standard (Intel's proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of MBR partition tables, which restrict a disk partition's size to a maximum of 2.19 TB (2.19 × 1012 bytes) or 2 TiB−512 bytes (2,199,023,255,040 bytes or 4,294,967,295 (232−1) sectors × 512 (29) bytes per sector).[1] GPT allows for a maximum disk and partition size of 9.4 ZB (9.4 × 1021 bytes) or 8 ZiB−512 bytes (9,444,732,965,739,290,426,880 bytes or 18,446,744,073,709,551,615 (264−1) sectors × 512 (29) bytes per sector).
"
From man page gdisk.
"
If Windows is to boot from a GPT disk, a partition of type Microsoft Reserved (gdisk internal code 0x0C01) is recommended. This partition should be about 128 MiB in size. It ordinarily follows the EFI System Partition and immediately precedes the Windows data partitions
"


You can see that GPT is a standard in use because of either limitations or by a need rather than an OS driven issue.

GPT is actually a much better way to set up a partition table. I do think I could have done better designing the details, but this is still so much better than what we had before. I use GPT even on my netbook that has just a 32GB SSD.

BTW, the way I would have designed a partition table format, those limitations that GPT has would not even exist. But at this point, it's not worth trying to overcome the momentum of GPT for what are currently just minor detail differences. Still, I do think a better partitioning tool is needed, at least for command line usage. So I might work on that when I have some time.

Still, none of this explains why systems like BSD and Solaris have partition type codes that are different than Windows, and Linux does not. Who picked that number (for each), anyway?


All times are GMT -5. The time now is 09:20 PM.