-
Notifications
You must be signed in to change notification settings - Fork 95
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
Report busy partitions; disable MD and LVM auto-activation #276
Conversation
This will only work for users that install via the kernel arguments...which is probably OK but we also want to support (if not emphasize) running coreos-installer via custom systemd units instead (possibly wrapped with other units before/after etc.) right? Clearly an admin could inject those config fragments via Ignition...so maybe they'd end up in our documentation? Can LVM be suppressed by systemd units instead? That's probably simpler if so. I'd assume MD can be suppressed by a kernel argument too? |
You're right that this doesn't work for custom coreos-installer units. Would it make sense to supply a custom target ( There's no karg to suppress MD assembly in the real root. For LVM, it might be sufficient to mask or override |
Probably the cleanest but also the hardest fix would be to have Wait actually, wouldn't it work to just |
Hmm, I'm wary of trying to make coreos-installer that smart. At best, I agree with #276 (comment) that this should probably be a switch. And then we should be more targeted about it, e.g.: if the user provides the switch, then de-activate all the layers which are directly in the mount hierarchy for the target device. This is harder to do though. I think the new "Partitions in use" error message is a great improvement and might even be enough to guide users on what they need to do. |
That feels odd to me. If run from the command line, I think it's the user's job to give us a disk that's not currently in use, and if it is, they're in the best position to correct that. And if run automatically by the operating system, it's the OS' job to not automatically start using parts of the target disk. That view might be controversial though.
We can't wipe any data we're not actually going to overwrite; see #172.
Yeah, I'm in favor of making the incremental improvement and seeing where that gets us. |
lsblk output includes holders such as running MD or DM devices that are using a partition, and those can't be disabled without also disabling partition enumeration. Filter out every output line that doesn't describe an actual partition.
If we don't have exclusive access to the disk, report a list of busy partitions as a debugging aid.
Reserve systemd/ for things that plug directly into systemd, and move the wrapper script to a new scripts/ directory.
Updated. I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me! One comment, LGTM otherwise.
Ensure leftover MD and LVM partitions on the target disk are not automatically activated, thus preventing the installer from gaining exclusive access to the disk. Do this via a new coreos-installer-pre.target, so custom units that run coreos-installer can conveniently Require/After our setup code.
The problem this fixes seems to still exist? |
Ensure leftover MD and LVM partitions on the target disk are not automatically activated if install kargs are used, so they don't prevent the installer from gaining exclusive access to the disk.
Also extend the installer to report a list of busy partitions as a debugging aid. Example output:
Fixes #261.