1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/metadata
David Teigland 0b6782fa01 pvscan: add options listlvs listvg checkcomplete
pvscan --cache <dev>
    . read only dev
    . create online file for dev

pvscan --listvg <dev>
    . read only dev
    . list VG using dev

pvscan --listlvs <dev>
    . read only dev
    . list VG using dev
    . list LVs using dev

pvscan --cache --listvg [--checkcomplete] <dev>
    . read only dev
    . create online file for dev
    . list VG using dev
    . [check online files and report if VG is complete]

pvscan --cache --listlvs [--checkcomplete] <dev>
    . read only dev
    . create online file for dev
    . list VG using dev
    . list LVs using dev
    . [check online files and report if VG is complete]
    . [check online files and report if LVs are complete]

[--vgonline]
can be used with --checkcomplete, to enable use of a vg online
file.  This results in only the first pvscan command to see
the complete VG to report 'VG complete', and others will report
'VG finished'.  This allows the caller to easily run a single
activation of the VG.

[--udevoutput]
can be used with --cache --listvg --checkcomplete, to enable
an output mode that prints LVM_VG_NAME_COMPLETE='vgname' that
a udev rule can import, and prevents other output from the
command (other output causes udev to ignore the command.)

The list of complete LVs is meant to be passed to lvchange -aay,
or the complete VG used with vgchange -aay.

When --checkcomplete is used, lvm assumes that that the output
will be used to trigger event-based autoactivation, so the pvscan
does nothing if event_activation=0 and --checkcomplete is used.

Example of listlvs
------------------

$ lvs -a vg -olvname,devices
  LV     Devices
  lv_a   /dev/loop0(0)
  lv_ab  /dev/loop0(1),/dev/loop1(1)
  lv_abc /dev/loop0(3),/dev/loop1(3),/dev/loop2(1)
  lv_b   /dev/loop1(0)
  lv_c   /dev/loop2(0)

$ pvscan --cache --listlvs --checkcomplete /dev/loop0
  pvscan[35680] PV /dev/loop0 online, VG vg incomplete (need 2).
  VG vg incomplete
  LV vg/lv_a complete
  LV vg/lv_ab incomplete
  LV vg/lv_abc incomplete

$ pvscan --cache --listlvs --checkcomplete /dev/loop1
  pvscan[35681] PV /dev/loop1 online, VG vg incomplete (need 1).
  VG vg incomplete
  LV vg/lv_b complete
  LV vg/lv_ab complete
  LV vg/lv_abc incomplete

$ pvscan --cache --listlvs --checkcomplete /dev/loop2
  pvscan[35682] PV /dev/loop2 online, VG vg is complete.
  VG vg complete
  LV vg/lv_c complete
  LV vg/lv_abc complete

Example of listvg
-----------------

$ pvscan --cache --listvg --checkcomplete /dev/loop0
  pvscan[35684] PV /dev/loop0 online, VG vg incomplete (need 2).
  VG vg incomplete

$ pvscan --cache --listvg --checkcomplete /dev/loop1
  pvscan[35685] PV /dev/loop1 online, VG vg incomplete (need 1).
  VG vg incomplete

$ pvscan --cache --listvg --checkcomplete /dev/loop2
  pvscan[35686] PV /dev/loop2 online, VG vg is complete.
  VG vg complete
2021-10-07 12:06:49 -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 for possible NULL segtype 2021-09-20 14:26:09 +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 pvscan: add options listlvs listvg checkcomplete 2021-10-07 12:06:49 -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