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

improve lvm module #1673

Merged
merged 8 commits into from Feb 2, 2022
Merged

improve lvm module #1673

merged 8 commits into from Feb 2, 2022

Conversation

teigland
Copy link
Contributor

Changes

This series makes various updates to the lvm module:

  • removes support for the unused lvm snapshot management feature
  • removes automated editing of deprecated lvm.conf lvmetad settings
  • removes an unused udev rule
  • replaces the use of --partial with --activationmode degraded
  • removes checks for using options that have existed for many years
  • uses the filter generated by dracut when lvm.conf has no filter set
  • only attempts to activate an LV when the LV is seen on devices

Checklist

  • [x ] I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #

@github-actions github-actions bot added lvm Issues related to the lvm module modules Issue tracker for all modules labels Dec 14, 2021
@johannbg
Copy link
Collaborator

@teigland your PR is failing the shell linter in quite few places. Have a look at the detail section of the linter check.

The feature of managing lvm snapshots has no known
recent usage.  It is unknown if it works.  The lvm
developers do not wish to maintain or support it.
Remove support for modifying use_lvmetad and locking_type
settings in lvm.conf for lvm versions 2.2.*.  Recent lvm
versions (2.3.*) do not include lvmetad or locking_type.
This cleanup simplifies code maintenance.

To use the lvm module with older versions (2.2), a user
would need to ensure that lvmetad settings are disabled
in the initrd's lvm.conf rather than relying on the lvm
dracut mode to modify their lvm.conf.
This udev rule runs pvscan to autoactivate VGs, which dracut
does not want to do, and previously disabled by editing the
rule file and commenting out lines.

This also stops /dev/disk/by-id/lvm-pv-uuid-* symlinks from
being created in the initrd.
The --partial option will activate a linear (or other) LV
without segments for missing devices, which is unlikely to
be useful. The intention was to activate raid LVs in a useful
form while missing devices, which is specified with the option
--activationmode degraded.
Drop checking for options that have been available for
at least ten years.  This simplifies code maintenance.

Add the new --nohints option (when available) to disable
the use of hints which is not useful during startup.
Previously, the lvm device filter generated by dracut
would not be used if any lvm.conf file existed in the
initrd.  Change this so that the generated filter will
be used when the included lvm.conf has no filter set.
Change the command listing LVs from lvscan to lvs, and list
only the LV names that are being activated.  Before attempting
to activate an LV, check that that LV name appears in the
lvs command output.  This avoids wasting time running an
lvchange command that we know will fail.
@teigland
Copy link
Contributor Author

@teigland your PR is failing the shell linter in quite few places. Have a look at the detail section of the linter check.

Hi, I'm uncertain about the lint recommendation to use quotes around $scan_args and $LVs here:

LVSLIST=$(lvm lvs $scan_args --noheading -o lv_full_name,segtype $LVS)

When I tried adding quotes around that $scan_args, it produced a command with single quotes around the value, which I couldn't figure out.

So, in my updated branch I'm going to try adding # shellcheck disable=SC2086 prior to that line, since that seems to be how other similar instances are handled. If there's a better solution please let me know. Thanks

The 69-dm-lvm-metad.rules udev rule has been removed from
the initrd, because it's been dropped by recent upstream
lvm versions, and it never performed any primary function
within the initrd.  But, it did have the job of setting
LVM_MD_PV_ACTIVATED=1 for active md devices used by PVs.
That step needs to be restored, and is now included in
64-lvm.rules.
@johannbg johannbg enabled auto-merge (rebase) December 28, 2021 23:57
@stale
Copy link

stale bot commented Jan 28, 2022

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Jan 28, 2022
@johannbg johannbg removed the stale communication is stuck label Jan 28, 2022
@johannbg johannbg merged commit 164e5eb into dracutdevs:master Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lvm Issues related to the lvm module modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants