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

Make RAW disks recovery partition expandable #2159

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

davidcassany
Copy link
Contributor

This PR makes the recovery partition expandable, so the RAW disk image created by the "build-disk" command only includes the EFI partition, OEM partition and the Recovery partition sized as the recovery image it includes. On first boot the recovery partition is resized to the configured size for recovery (4G by default) and state and persistent partitions created. Finally the deploy command after the first full boot resets from recovery to install an active system to state partition.

In order to do that this PR adds a new Yip stage at boot. Why? Because the earliest stage we had (rootfs) is called once the root partition (recovery in this case) is already mounted, hence too late to run any expand operation. The new stage introduced in this PR is called after OEM partition is mounted, but before root device is mounted. This allows running an expand partition operation for recovery on first boot.

As a result RAW images will no longer be around 4G but around 1G, almost like ISO's.

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany requested a review from a team as a code owner August 7, 2024 18:06
@davidcassany davidcassany self-assigned this Aug 8, 2024
Copy link
Contributor

@kkaempf kkaempf left a comment

Choose a reason for hiding this comment

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

worth a try 😉

@kkaempf kkaempf added kind/enhancement New feature or request area/rawdisk labels Aug 8, 2024
@davidcassany davidcassany merged commit b1cc863 into rancher:main Aug 8, 2024
29 checks passed
@davidcassany davidcassany deleted the smaller_disks branch August 8, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rawdisk kind/enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants