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

bin/flatcar-install: detect device mapper usage #39

Merged
merged 1 commit into from
May 17, 2021

Conversation

pothos
Copy link
Member

@pothos pothos commented May 12, 2021

The search for free disks was aware of mount points but did not
consider device mapper usage (e.g., LUKS or LVM) and went on to
overwrite the disk while it still was used. This can disrupt the
installation process or lead to unnoticed data corruption. It was also
not save when run on a system with active disk usage.
For disks with active device mapper entries the user must first remove
the mappings. For LVM this can be done with
lvchange -an /dev/mapper/PREFIX* (just /* also works to disable all LVM
mappings).

Fixes flatcar/Flatcar#332

How to use

For PXE-based installation, add an lvchange -an /dev/mapper/* command before running flatcar-install to disable any present LVM partitions that got auto-activated.

Testing done

Equinix Metal kola tests

The search for free disks was aware of mount points but did not
consider device mapper usage (e.g., LUKS or LVM) and went on to
overwrite the disk while it still was used. This can disrupt the
installation process or lead to unnoticed data corruption. It was also
not save when run on a system with active disk usage.
For disks with active device mapper entries the user must first remove
the mappings. For LVM this can be done with
lvchange -an /dev/mapper/PREFIX* (just /* also works to disable all LVM
mappings).

Fixes flatcar/Flatcar#332
@pothos pothos requested a review from a team May 12, 2021 10:44
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request May 14, 2021
This pulls in a behavior change in the flatcar-install script to
detect if a disk is used through a device mapper entry when searching
for free disks with -s.
flatcar/init#39

Fixes flatcar/Flatcar#332
@pothos pothos marked this pull request as ready for review May 14, 2021 17:14
@pothos pothos merged commit cbb8ec1 into flatcar-master May 17, 2021
@pothos pothos deleted the kai/detect-device-mapper branch May 17, 2021 10:38
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request May 17, 2021
This pulls in a behavior change in the flatcar-install script to
detect if a disk is used through a device mapper entry when searching
for free disks with -s.
flatcar/init#39

Fixes flatcar/Flatcar#332
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.

flatcar-install fails to detect active LVM partitions
2 participants