Bug 2178043 - Use GPT partition types compatible with systemd-gpt-auto-generator by default
Summary: Use GPT partition types compatible with systemd-gpt-auto-generator by default
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-14 09:58 UTC by Vitaly Kuznetsov
Modified: 2023-07-28 14:31 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2160074 0 unspecified NEW RFE: please consider using the GPT partition type IDs from the discoverable partitions spec 2023-03-15 09:26:39 UTC
Red Hat Issue Tracker FC-795 0 None None None 2023-03-27 11:46:51 UTC

Description Vitaly Kuznetsov 2023-03-14 09:58:18 UTC
To be compatible with systemd-gpt-auto-generator (https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html) for partitioning auto discovers, specific partition GUIDs need to be used (see "Table 1. Partition Type GUIDs"). The suggestion is to use these partition GUIDs by default for 'standard' (non-lvm) partitioning.

E.g. on x86_64 system, root filesystem will need to be created with "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" partition GUID (and not "Linux filesystem" 0FC63DAF-8483-4772-8E79-3D69D8477DE4 used by default today).

GPT auto generator is an important feature in conjunction with Unified Kernel Images (UKIs). As UKI's kernel command line is set during kernel package build, it becomes impossible to pass custom 'kernel=' options to the kernel so partitioning must be discovered automatically.

Making it possible to install UKI instead of a normal kernel with anaconda in some cases may also be interesting but I suggest to create a separate BZ for it (if needed). This one is solely focused on partitioning.

Comment 1 Brian Lane 2023-03-14 17:03:38 UTC
FYI - pyparted support for the new parted UUID functions will need to be backported/rebased for this to work.

Also, I don't think we should be changing the default partition UUIDs in the middle of a release cycle. This seems like a change that should at least be optional, if not wait for the next major RHEL release.

Comment 2 Vitaly Kuznetsov 2023-03-15 09:26:40 UTC
(In reply to Brian Lane from comment #1)
> 
> Also, I don't think we should be changing the default partition UUIDs in the
> middle of a release cycle. This seems like a change that should at least be
> optional, if not wait for the next major RHEL release.

The change would only affect new setups, not existing ones so I was thinking 
it might still be OK to change the default. I may, however, underestimate the
importance of Partition GUIDs staying constant for some setups.

Providing an option in RHEL9 and making it the default in RHEL10 also sounds
like a very reasonable approach.

Comment 3 Jiri Konecny 2023-03-16 10:12:20 UTC
Hello, are you planning to backport Unified kernel support to RHEL-9? If not than I would focus on getting this upstream and RHEL-10 from there instead.

Comment 4 Brian Lane 2023-03-16 15:51:08 UTC
(In reply to Vitaly Kuznetsov from comment #2)

> The change would only affect new setups, not existing ones so I was thinking 
> it might still be OK to change the default. I may, however, underestimate the
> importance of Partition GUIDs staying constant for some setups.

I don't have any specific examples, but I'm sure there are people who do an install and then validate it using their own tools. It would be a surprising change to have the default UUIDs change without asking for it.

> 
> Providing an option in RHEL9 and making it the default in RHEL10 also sounds
> like a very reasonable approach.

I think that's the best approach.

Comment 5 Vitaly Kuznetsov 2023-03-16 17:05:45 UTC
(In reply to Jiri Konecny from comment #3)
> Hello, are you planning to backport Unified kernel support to RHEL-9? If not
> than I would focus on getting this upstream and RHEL-10 from there instead.

Yes, we already have it (TechPreview) in 9.2 https://bugzilla.redhat.com/show_bug.cgi?id=2142102

Note, there's no hard requirement on anaconda to support that at this moment, UKI
is only going to be used for Confidential VMs in clouds and these normally use
pre-generated images. For kickstart installs, Partition GUIDs can also be adjusted with
e.g. sfdisk when needed. This is more a 'nice to have' feature.

Comment 6 Jan Stodola 2023-03-23 12:48:26 UTC
Brain, this functionality doesn't seem to be fully implemented upstream, the following UUIDs were created on a disk with GPT disk label (tested using Fedora rawhide):

[root@localhost ~]# lsblk -p -o NAME,PARTTYPE,mountpoint /dev/vda
NAME        PARTTYPE                             MOUNTPOINT
/dev/vda                                         
├─/dev/vda1 c12a7328-f81f-11d2-ba4b-00a0c93ec93b /boot/efi
├─/dev/vda2 0fc63daf-8483-4772-8e79-3d69d8477de4 /boot
├─/dev/vda3 0fc63daf-8483-4772-8e79-3d69d8477de4 /
└─/dev/vda4 0fc63daf-8483-4772-8e79-3d69d8477de4 /home
[root@localhost ~]#

Is anything missing in pyparted or any other component needs to be involved?


Vitaly, I agree with Brian that we should not change the current behavior in RHEL-9, and introduce this feature in RHEL-10. This bug should rather be tracked against Fedora to make sure it's fully implemented there first.

Comment 7 Brian Lane 2023-03-24 15:24:23 UTC
(In reply to Jan Stodola from comment #6)
> Brain, this functionality doesn't seem to be fully implemented upstream, the
> following UUIDs were created on a disk with GPT disk label (tested using
> Fedora rawhide):
> 
> [root@localhost ~]# lsblk -p -o NAME,PARTTYPE,mountpoint /dev/vda
> NAME        PARTTYPE                             MOUNTPOINT
> /dev/vda                                         
> ├─/dev/vda1 c12a7328-f81f-11d2-ba4b-00a0c93ec93b /boot/efi
> ├─/dev/vda2 0fc63daf-8483-4772-8e79-3d69d8477de4 /boot
> ├─/dev/vda3 0fc63daf-8483-4772-8e79-3d69d8477de4 /
> └─/dev/vda4 0fc63daf-8483-4772-8e79-3d69d8477de4 /home
> [root@localhost ~]#
> 
> Is anything missing in pyparted or any other component needs to be involved?

Depends on what you mean by fully implemented :) In rawhide you can set arbitrary UUIDs with parted by using the 'type' command. pyparted also supports this new libparted API. The default UUIDs have not changed though, that would need to be implemented by Blivet (and possibly Anaconda). So if you are just creating new partitions you will not see anything different.

Comment 8 Jan Stodola 2023-03-24 16:07:09 UTC
By fully implemented I meant that the installer would automatically set the correct UUIDs for the partitions based on their mount points or usage (/boot, /, /home, /usr, swap,...) as described here: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/

So, I'm reassigning this bug to blivet for now, to be implemented in Fedora first.

Comment 9 Vojtech Trefny 2023-03-27 11:45:46 UTC
Support for the discoverable partitions was added in blivet 3.7.0 which is available in Fedora 38 so if there isn't anything else needed, I think we can either close this as duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1075288 or move back to Anaconda.

Comment 10 Jan Stodola 2023-03-27 12:08:32 UTC
OK, so moving back to anaconda to start using discoverable partitions.
Here is the relevant blivet PR: https://github.com/storaged-project/blivet/pull/1080

Comment 11 Jiri Konecny 2023-04-13 11:52:43 UTC
Hi Vojta, what is required from Anaconda to enable this?

Comment 12 Vojtech Trefny 2023-06-21 08:21:53 UTC
You just need to set the `gpt_discoverable_partitions` flag to True, everything else will be automatic.

Comment 13 Vladimír Slávik 2023-07-27 19:25:22 UTC
Here is a draft PR just to check it does what advertised. What interface do we use to make it optional? Since it's a single global flag in Blivet, it seems a poor match for anything in kickstart. I wonder if it should be a config option or a boot option?

https://github.com/rhinstaller/anaconda/pull/4974

Comment 14 Vitaly Kuznetsov 2023-07-28 14:25:10 UTC
On the one hand, making it configurable make sense but honestly I don't see why this shouldn't be the new default:
I don't see downsides from using this new GUIDs even in the autodiscovery feature is not going to be used. It may,
however, make sense to preserve the existing behavior in RHEL.

In case it's possible to set per-partition, I'd suggest to make it a 'part' flag, e.g. '--legacy-guid' but
looking at he pull request I think it's global. In that case it can be a 'bootloader' option I guess...

Comment 15 Vojtech Trefny 2023-07-28 14:31:51 UTC
Can this be a problem with dualboot -- can we break booting of a preexisting installation that uses systemd boot if we suddenly add a new Fedora / partition with "root GUID"? If this isn't a problem, I think it could be default without a configuration option.


Note You need to log in before you can comment on or make changes to this bug.