-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify and match existing partitions based on label #1219
Comments
I've made the same mistake, multiple times. The current behavior is described by the spec, though it requires some close reading:
udev assumes that every partition label and every filesystem label is unique within the system, and FCOS inherits that assumption for system partitions. However, the GPT spec has no such requirement for partition labels. Ignition currently follows the GPT spec in allowing duplicate partlabels. (Actually, Ignition only allows creating multiple new partitions with the same label if the partition number is We could decide to be more opinionated in this area, but it'd be a breaking change that would need to wait for spec 4.0. We'd need to decide what to do with existing partition tables that have duplicate labels; it'd probably make the most sense to error out. Also, we'd only be able to enforce uniqueness on a single disk; I don't think there's a technical justification for enforcing uniqueness across the entire system, nor is there a way to ensure we've seen every disk that could possibly show up later. Since we can't solve systemwide uniqueness for udev, IMO we should think carefully about whether we'd gain enough from solving only per-disk uniqueness. In the short term, it'd be good to document this behavior more explicitly. Also, Butane should probably check for filesystems with partition |
Butane RFE: coreos/butane#243 |
I read that spec too over the weekend. This part is interesting:
Maybe it's just me, but the
Yeah. I guess I'm interested in the uses. Can we think of a good use of multiple same labeled partitions? If not I say we default to requiring unique labels and then allowing an override (
I'm good with waiting til spec 4.0 and also good with erroring out. Maybe
I'm good with single disk enforcement. |
I've also hit this multiple times and think it's reasonable to tighten this up. It also leads to documentation to expose implementation details: coreos/fedora-coreos-docs#248 (comment) |
(Coming here from coreos/fedora-coreos-tracker#855 ) It looks to me like we need a "do what I really want" flag like
In this case though, we're going to mount something from
Right, and in that case inject |
Okay, I see what you mean. The spec is written from the perspective of the config contents, and what it actually means is: "Every specified partition must have a unique number, or ... a unique label".
We've generally tried to avoid flags, and implementing one here would be a bit messy (because the lookup key needs to change depending on a flag field in the parent struct). But we may not have a choice. If we made the change in spec 4.0 and removed the old behavior, we'd be removing functionality present in spec 3.x, which would make old configs non-translatable. And I don't think we want to go there again. But you're right that we could hardwire the flag in Butane. That'd involve a major bump of the Butane spec, but there's no requirement to translate Butane configs between versions (since Butane carries parallel implementations) so that'd be relatively painless. (Except that we can't bump the major version of the
There's nothing preventing multiple partitions from having the same label and racing with each other.
I meant that it could warn the user that they're probably not doing what they intend. |
Feature Request
Currently if I have a butane config like:
I assume that the
label: root
entry will match the existing partition with theroot
label and apply specified changes to that partition.What I end up with is two partitions with a
root
partition label and my actual root partition is the minimal 1.8G:We should probably try to match entries to existing labels. Also maybe we should just enforce that partition labels are unique such that there can't be more than one partition with that label.
Other Information
The text was updated successfully, but these errors were encountered: