[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need for a unique Linux GPT GUID type code (PATCH included)
From: |
Rod Smith |
Subject: |
Re: Need for a unique Linux GPT GUID type code (PATCH included) |
Date: |
Sat, 25 Jun 2011 16:05:29 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110514 Lightning/1.0b3pre Thunderbird/3.1.10 |
Hi,
I'm attaching another patch that should be applied INSTEAD OF my earlier
patch in order to support a new Linux-only GUID type code. The new patch
is intended to address concerns about breaking programs that might
assume the Microsoft Basic Data partition type code on Linux partitions
by giving the option of setting that type code on Linux partitions. What
this patch does is:
- It creates a new Linux-only filesystem type code
(0FC63DAF-8483-4772-8E79-3D69D8477DE4)
- It sets the new Linux type code on new partitions by default.
- As in the current 3.0 code, non-Linux filesystems (FAT, NTFS,
HFS+, etc.), and some other partition types (Linux swap, LVM,
etc.) get codes that override the default.
These three features are as in my earlier patch. The new changes are:
- My patch creates a new flag, "msftdata", to explicitly represent the
Microsoft Basic Data type code. This flag is automatically set
on new FAT and NTFS partitions.
- The msftdata flag may be added to any partition, thus changing
its type code GUID.
- The msftdata flag may be removed from any partition (via "set
# msftdata off") EXCEPT for those with NTFS or FAT filesystems.
This limitation is a consequence of the way the current code
handles flags; it auto-detects their filesystem types when flags
are removed and uses that auto-detection to set the type code.
Thus, removing the msftdata flag from an NTFS or FAT partition
results in the filesystem type being auto-detected and the flag
re-set. I don't see an easy way to change this, and trying to
do so would leave the question of what filesystem type code to
set on the partition.
- The msftdata flag may be removed from NTFS or FAT partitions by
setting a competing flag (bios_grub, boot, lvm, msftres, etc.).
This moderates the above limitation; essentially, you just can't
set an NTFS or FAT partition to use the new Linux type code, the
HFS+ type code, or other filesystem type codes that are NOT
associated with flags. You CAN set them to other type codes --
most importantly, "boot" (for an EFI System Partition).
Assuming this patch is accepted into the program, the effect will be a
rapid use of the new Linux-specific type code in NEW GPT installations
as the new version is adopted downstream. Existing installations will be
unaffected unless users notice the "msftdata" flag and decide to remove
it. If the new type code causes problems, users can add the msftdata
flag to their partitions until whatever program makes assumptions about
Linux filesystems being on Microsoft Basic Data partitions is updated.
I considered implementing these changes the other way -- that is, to
create a flag for the new type code. This would have resulted in slower
adoption of the new code, which would minimize the risk of unknown
problems showing up in large numbers but would maximize the risk of
users trashing their Linux installations in Windows. Doing it this way
seems backwards on a Linux system, too, and the limitation in the
current patch of being unable to remove an msftdata flag from NTFS or
FAT partitions would instead apply to the hypothetical linux flag on
partitions with Linux filesystems, which would defeat the goal of
enabling users to switch from the new Linux type code to the Microsoft
Basic Data type code if the new code causes problems. Thus, it just
doesn't make sense to implement it that way, at least not without
addressing this limitation.
The fact that a partition with an NTFS or FAT filesystem must always
have some sort of flag in my patched version of parted is weird and
might confuse some users, but I don't see any way out of that problem
except by either using my original patch, which doesn't give users the
option of backing out of the new type code, or completely rewriting the
way parted handles partition type codes. The latter would be a huge
undertaking, but if the parted Powers That Be choose to use my simpler
earlier patch, that's fine by me.
--
Rod Smith
address@hidden
http://www.rodsbooks.com
patch.diff
Description: Text document