1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/metadata
David Teigland a7de7a7bc0 add activation services
New systemd services for startup:

lvm-devices-wait.service
  Used in place of systemd-udev-settle, this service waits
  for udev+pvscan to process PVs listed in system.devices.
  It runs the command "lvmdevices --wait pvsonline".
  This only waits for PVs that can be matched to a device in
  sysfs, so it only waits for devices attached to the system.
  It waits specifically for the /run/lvm/pvs_online/<pvid>
  files to be created by pvscan.  It quits waiting after a
  configurable number of seconds.  This service gives the
  first activation service a chance to activate VGs from
  PVs that are available immediately at startup.  If this
  service quits waiting before all the expected pvid files
  appear, then the VG associated with those PVs will most
  likely be activated by the -last service rather than the
  initial -main service.  If those PVs are even slower to
  complete processing than the -last service, then the VG
  will be activated by event activation whenever they are
  finally complete.

lvm-activate-vgs-main.service
  Calls "vgchange -aay", after lvm-devices-wait, to activate
  complete VGs.  It only considers PVs that have been
  processed by udev+pvscan and have pvs_online files.
  This is expected to activate VGs from basic devices
  (not virtual device types) that are present at startup.

lvm-activate-vgs-last.service
  Calls "vgchange -aay", after multipathd has started, to
  activate VGs that became available after virtual device
  services were started, e.g. VGs on multipath devices.
  Like -main, it only looks at PVs that have been processed
  by pvscan.

This vgchange in the -last service enables event activation
by creating the /run/lvm/event-activation-on file.  Event
activation will activate any further VGs that appear on the
system (or complete udev processing) after the -last service.
In the case of event activation, the udev rule will run
vgchange -aay <vgname> via a transient service
lvm-activate-<vgname>.service.  This vgchange only scans
PVs in the VG being activated, also based on the pvs_online
files from pvscan.

When there are many VGs that need activation during system
startup, the two fixed services can activate them all much
faster than activating each VG individually via events.

lvm.conf auto_activation_settings can be used to configure
the behavior (default ["service_and_event", "pvscan_hints"]).

"service_and_event" - the behavior described above, where
activation services are used first, and event activation
is used afterward.

"service_only" - only lvm-activate-vgs-* are used, and
no event-based activation occurs after the services finish.
(Equivalent to setting lvm.conf event_activation=0.)

"event_only" - the lvm-activate-vgs* services are skipped,
and all VGs are activated individually with event-based
activation.

"pvscan_hints" - the vgchange autoactivation commands
use pvs_online files created by pvscan.  This optimization
limits the devices scanned by the vgchange command to only
PVs that have been processed by pvscan.
2021-10-29 16:29:42 -05:00
..
cache_manip.c cov: initialize attr 2021-09-13 12:34:41 +02:00
integrity_manip.c clang: keep metaname initialized 2021-09-15 15:24:56 +02:00
lv_alloc.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lv_manip.c cov: check pointer before dereferencing 2021-10-15 23:40:56 +02:00
lv.c cleanup: use already known lv size 2021-09-27 18:56:14 +02:00
lv.h lvremove: support faster removal of thin-pools 2021-03-11 00:18:01 +01:00
merge.c cov: raid: no more checks with missing areas 2021-07-28 00:49:28 +02:00
metadata-exported.h vdo: read new sysfs path 2021-09-09 15:24:15 +02:00
metadata.c add activation services 2021-10-29 16:29:42 -05:00
metadata.h pvscan: add options listlvs listvg checkcomplete 2021-10-07 12:06:49 -05:00
mirror.c gcc-fanalyzer: explicit test null not pass 2021-09-20 10:51:30 +02:00
pool_manip.c vgsplit: add support for option --poolmetadataspare 2021-07-21 15:56:33 +02:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_list.c cleanup: no backtraces needed after log_error 2021-03-10 01:11:52 +01:00
pv_manip.c cov: remove unneeded includes 2021-07-28 00:49:28 +02:00
pv_map.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv_map.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv.c cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
pv.h cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
raid_manip.c cleanup: use dm_list_empty 2021-10-06 15:43:31 +02:00
segtype.c segtype: add linear 2018-06-05 16:23:18 +02:00
segtype.h make: fix compilation for undefined RAID_INTERNAL 2021-09-27 18:56:14 +02:00
snapshot_manip.c gcc-fanalyzer: add extra check for origin_from_cow 2021-09-20 13:58:57 +02:00
takeover_matrix.h lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
thin_manip.c lvremove: fix removing thin pool with writecache on data 2021-05-24 16:09:35 -05:00
vdo_manip.c vdo: read new sysfs path 2021-09-09 15:24:15 +02:00
vg.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vg.h metadata: remember parsing size of VG metadata 2021-09-27 18:49:41 +02:00
writecache_manip.c writecache: use cleaner message instead of table reload 2021-01-28 15:14:25 -06:00