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

re-using existing disks when doing an install; re-creating partitions with Ignition #418

Closed
miabbott opened this issue Mar 10, 2020 · 7 comments
Labels
jira for syncing to jira

Comments

@miabbott
Copy link
Member

During our internal cabal meeting, the topic of installing *CoreOS onto existing infrastructure was discussed; specifically the need for preserving existing partitions during the install phase.

One of the suggested approaches was to determine the existing partition table of a disk, determine which partitions need to be preserved, and then have Ignition create the partition table with the preserved partitions included.

@jlebon suggested we discuss this path for installing + preserving partitions in more detail, so filing this issue as place to start.

cc: @glennswest

@bgilbert
Copy link
Contributor

Specifically, the Ignition config for the live system would:

  1. Run a unit Before=coreos-installer.service that would probe the partition table and detect the relevant partition/offset/length.
  2. Run coreos-installer as usual. For safety we might want something like Consider supporting a safety check to avoid overwriting data partitions coreos-installer#190.
  3. Run another unit After=coreos-installer.service which recreates the desired data partition.

As an alternative, we could avoid step 3 by having step 1 inject the partition info into the Ignition config. But the proposed approach would be more self-contained.

@travier
Copy link
Member

travier commented May 26, 2020

With this workflow, the data partitions selected for preservation may end up being lost if an issue were to happen (power loss, etc.) between the beginning of the installation process (step 2) and the partition restoration step (3).

@travier
Copy link
Member

travier commented May 26, 2020

Also related to: #399

@travier travier self-assigned this May 26, 2020
@travier travier added the jira for syncing to jira label May 26, 2020
@travier
Copy link
Member

travier commented May 26, 2020

I am currently looking if it could be possible to reuse a partition layout while ensuring there is enough space for the installation thus avoiding the repartitioning step.

@travier travier removed their assignment May 27, 2020
@glennswest
Copy link

glennswest commented Jun 15, 2020

Actually in the version using classic installer, I save the partitions numbers above partition #4, let the install run, and append them after the install. Further if there is no partitions above 4, I create a data partition. Generally with disk sizes, there is plenty of space. This approach works well.
In the bash mode, I use sfdisk to pull the existing partitions, and concat the saved partitions.
Need to look how to do this in rust.

Done properly no change in ignition is needed.

@bgilbert
Copy link
Contributor

Implemented via coreos-installer install --save-partindex/--save-partlabel in coreos-installer 0.5.0.

@dustymabe
Copy link
Member

Thanks @bgilbert!

The fix for this went into stable stream release 32.20200809.3.0, which was released a few weeks ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
Development

No branches or pull requests

5 participants