1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-07 21:18:59 +03:00
lvm2/lib/metadata
David Teigland 7578a30534 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-07-14 12:51:59 -05:00
..
cache_manip.c cache: use interruptible_usleep 2021-03-14 16:34:38 +01:00
integrity_manip.c blkid: simplify fs block size check 2021-05-05 16:15:10 -05:00
lv_alloc.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lv_manip.c vdo: support vdo_pool_header_size 2021-06-28 20:41:07 +02:00
lv.c cache: activation cache_check on cachevol 2020-12-09 17:36:09 -06:00
lv.h lvremove: support faster removal of thin-pools 2021-03-11 00:18:01 +01:00
merge.c cleanup: simpler checks first 2021-03-08 15:43:27 +01:00
metadata-exported.h vdo: support vdo_pool_header_size 2021-06-28 20:41:07 +02:00
metadata.c pvscan: add options listlvs listvg checkcomplete 2021-07-14 12:51:59 -05:00
metadata.h pvscan: add options listlvs listvg checkcomplete 2021-07-14 12:51:59 -05:00
mirror.c wipe: convert zero_value to uint8_t 2020-09-15 22:52:25 +02:00
pool_manip.c debug: more use of display_lvname 2021-03-10 01:11:52 +01: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 backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +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 device usage based on devices file 2021-02-23 16:43:32 -06:00
pv.h device usage based on devices file 2021-02-23 16:43:32 -06:00
raid_manip.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
segtype.c segtype: add linear 2018-06-05 16:23:18 +02:00
segtype.h segtypes: macros for error and zero segtypes 2021-03-18 18:34:57 +01:00
snapshot_manip.c lvremove: use to_remove for snapshot removal 2021-03-15 11:11:35 +01: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: support vdo_pool_header_size 2021-06-28 20:41:07 +02:00
vg.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vg.h backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
writecache_manip.c writecache: use cleaner message instead of table reload 2021-01-28 15:14:25 -06:00