Skip to content
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

Warn if config attempts to reuse partition by label #377

Closed
bgilbert opened this issue Aug 4, 2022 · 0 comments · Fixed by #436
Closed

Warn if config attempts to reuse partition by label #377

bgilbert opened this issue Aug 4, 2022 · 0 comments · Fixed by #436
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers jira validation Issue related to config validation

Comments

@bgilbert
Copy link
Contributor

bgilbert commented Aug 4, 2022

Consider this config:

variant: fcos
version: 1.4.0
storage:
  disks:
    - device: /dev/sdb
      wipe_table: false
      partitions:
        - label: foo

When the system is first provisioned with a blank /dev/sdb, Ignition will create a partition foo starting 1 MiB into the disk and extending to the end of the disk. If the system is then reprovisioned, Ignition will create a second partition foo in the first MiB of the disk:

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        33554398   16.0 GiB    8300  foo
   2              34            2047   1007.0 KiB  8300  foo

If the system is provisioned a third time, Ignition will fail.

This config appears to reuse the partition when reprovisioning, but actually doesn't, because Ignition matches existing partitions only by partition number and not by label (coreos/ignition#1219). We should fix that, but as a start, we can warn about it.

We should warn if a disk has wipe_table: false and any partitions have number: 0. However, we need to special-case the root disk: since its partition table is rewritten on every reprovision, it's valid not to specify a partition number there, and we shouldn't warn. Unfortunately, the only way to distinguish the root disk is if it's specified via the /dev/disk/by-id/coreos-boot-disk symlink, and legacy configs won't do that.

Proposal: add a warning in the experimental spec only, and only for devices other than coreos-boot-disk. Phrase the message to make it clear that the warning can be avoided for the root disk by specifying it as /dev/disk/by-id/coreos-boot-disk.

@bgilbert bgilbert added enhancement New feature or request good first issue Good for newcomers labels Aug 4, 2022
@prestist prestist self-assigned this Aug 8, 2022
@bgilbert bgilbert added the jira label Aug 8, 2022
@bgilbert bgilbert added the validation Issue related to config validation label Jan 10, 2023
@prestist prestist assigned Adam0Brien and unassigned prestist Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers jira validation Issue related to config validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants