Skip to content

fcos translate.go: add warn on small or constrained root partition#378

Open
prestist wants to merge 4 commits intocoreos:mainfrom
prestist:warn-on-fs-too-small
Open

fcos translate.go: add warn on small or constrained root partition#378
prestist wants to merge 4 commits intocoreos:mainfrom
prestist:warn-on-fs-too-small

Conversation

@prestist
Copy link
Copy Markdown
Collaborator

@prestist prestist commented Aug 4, 2022

#211

Note I somehow dropped the '1' in the version for FCOS in the commit messages.. but before I update the commit structure lets make sure we are happy with the functional changes. Look at the first 2 commits, i.e the exp changes this is basically propagated to all versions back to 1_3 as you can see later with the fixup commits. Once approved I will merge the fixup commits with a rename to the commits to be inclusive of the changes!

@prestist prestist force-pushed the warn-on-fs-too-small branch from df3fd2e to 166e0d5 Compare August 5, 2022 18:29
@prestist prestist force-pushed the warn-on-fs-too-small branch 6 times, most recently from b95add4 to 98397ca Compare August 22, 2022 20:44
@prestist prestist force-pushed the warn-on-fs-too-small branch 2 times, most recently from 8a4a4c3 to 50f80a6 Compare August 29, 2022 15:49
@prestist prestist force-pushed the warn-on-fs-too-small branch from 50f80a6 to 8882e58 Compare January 15, 2026 14:19
@prestist prestist force-pushed the warn-on-fs-too-small branch 2 times, most recently from 74876cc to 78f8481 Compare January 28, 2026 21:24
@prestist prestist marked this pull request as ready for review January 28, 2026 21:37
Fixes: coreos#211, the root partition needs a certain amount of space, with
recent changes butane has the opportunity to warn when those expectations
are not met.

Check for contstraints caused by:
 - Partitions with out-of-order numbers
 - Auto-positioned partitions (StartMiB == 0 or nil)
 - Explicit partition positioning
Add test cases for:
 - Root partition constrained by disk position (not partition number)
 - Root partition with auto-positioned following partition (StartMiB=0)
 - Root partition NOT constrained when next partition has explicit StartMiB
 - Root partition size validation (too small, exactly 8GiB)
@prestist prestist force-pushed the warn-on-fs-too-small branch from 78f8481 to 530a65e Compare January 28, 2026 21:48
@prestist prestist changed the title WIP: fcos translate.go: add warn on small or constrained root partition fcos translate.go: add warn on small or constrained root partition Jan 29, 2026
@aaradhak
Copy link
Copy Markdown
Member

The first commit message says fcos v0_7_exp but there is no v0_7_exp directory. May be this should be fcos v1_7_exp?

@aaradhak
Copy link
Copy Markdown
Member

Minor: Typo in commit message body: "contstraints" should be "constraints"

ErrReuseByLabel = errors.New("partitions cannot be reused by label; number must be specified except on boot disk (/dev/disk/by-id/coreos-boot-disk) or when wipe_table is true")
ErrWrongPartitionNumber = errors.New("incorrect partition number; a new partition will be created using reserved label")
ErrRootTooSmall = errors.New("root should have 8GiB of space assigned")
ErrRootConstrained = errors.New("root is configured too small, and has no room to expand")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious if this can this be rephrased? shouldnt this error message say something like that it's configured to fill available space?


// In the boot_device.mirror case, nothing specifies partition numbers
// so match existing partitions only when `wipeTable` is false
if !util.IsTrue(disk.WipeTable) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand this wipetable change. The previous code only checked reserved partlabels when wipeTable is false. The current change now runs the root validation even when wipeTable is true. I guess it is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants