containers / bootc

Boot and upgrade via container images
https://containers.github.io/bootc/
Apache License 2.0
573 stars 71 forks source link

Provide warning when switching between distributions #610

Open p5 opened 2 months ago

p5 commented 2 months ago

Bootc is available on RHEL, CentOS and Fedora, and I recently accidentally bootc switched a server from Fedora to CentOS resulting in a broken system (emergency mode in AWS so couldn't change in the grub menu [1]), it would be good if somehow Bootc could detect when you're switching from one distribution to another and provide an appropriate warning.

This was completely my fault, and this operation isn't something I would expect bootc to work with, however a warning or error would help prevent others from making this same mistake.

[1] It's highly likely you can switch to the older grub boot entry from emergency mode, but it's not obvious how to do so (not Bootc's problem though), and the serial console is only available on the more expensive instance types

cgwalters commented 2 months ago

The specific problem here is likely that the c9s kernel doesn't understand the root filesystem setup (if you used btrfs for example, but also I think Fedora's mkfs.ext4 uses too new options for c9s too, etc).

There's a lot of questions around how we'd do anything in this space. I guess we could add a generic speedbump here when one tries to switch between ID as defined by /usr/lib/os-release, but that needs design for how one would override it if desired (bootc switch --allow-osid-override?).

Many of the problems that would occur here also would occur on major version downgrades though too though.