1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/scripts
Peter Rajnoha b21a8412c4 vgimportclone: also notify lvmetad about changes if it's used
All the LVM commands are run in mode without lvmetad use (since lvmetad
can't handle duplicates). When we're finished with vgimportclone, we
need to notify lvmetad about changes.

Before this patch (/dev/sda and /dev/sdb contains a copy VG called "vg"):
$ vgimportclone --basevgname vg_snap /dev/sdb
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  Physical volume "/tmp/snap.zcJ8LCmj/vgimport0" changed  1 physical volume changed / 0 physical volumes not changed
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  Volume group "vg" successfully changed
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  Volume group "vg" successfully renamed to "vg_snap"
  Reading all physical volumes.  This may take a while...
  Found volume group "vg" using metadata type lvm2
  Found volume group "fedora" using metadata type lvm2

$ vgs
  VG     #PV #LV #SN Attr   VSize   VFree
  fedora   1   2   0 wz--n-   9.50g      0
  vg       1   1   0 wz--n- 124.00m 120.00m

(...lvmetad doesn't see the new "vg_snap"!)

With this patch applied:
$ vgimportclone --basevgname vg_snap /dev/sdb
  ...
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  Volume group "vg" successfully renamed to "vg_snap"
Notifying lvmetad about changes since it was disabled temporarily.
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_snap" using metadata type lvm2
  Found volume group "fedora" using metadata type lvm2
  Found volume group "vg" using metadata type lvm2

$ vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  fedora    1   2   0 wz--n-   9.50g      0
  vg        1   1   0 wz--n- 124.00m 120.00m
  vg_snap   1   1   0 wz--n- 124.00m 120.00m

The "restart lvmetad before enabling it" message is a bit misleading
here - we should probably suppress this one, but we can't suppress
warning messages selectively at the moment and we don't want to lose
other warning/error messages printed...
2014-12-10 14:00:56 +01:00
..
lvm2create_initrd Add .gitignore files for an in-source-tree build. 2012-06-08 16:26:21 +01:00
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
blk_availability_init_red_hat.in scripts: blk-availability - use full name for clarity 2012-10-15 16:10:58 +02:00
blk_availability_systemd_red_hat.service.in scripts: blk-availability should be stopped before FCoE 2012-10-15 15:00:12 +02:00
blkdeactivate.sh.in blkdeactivate: fix endless loop if device(s) given and unable to umount/deactivate 2013-10-22 16:24:39 +02:00
clvmd_fix_conf.sh Use /bin/bash for scripts with bashisms 2010-05-14 11:33:20 +00:00
clvmd_init_red_hat.in initscripts: fix typo in clvmd initscript causing CLVMD_STOP_TIMEOUT variable to be ignored 2014-11-25 15:19:11 +01:00
cmirrord_init_red_hat.in initscripts: add pidfile reference in chkconfig header for clvmd and cmirrord 2013-06-07 14:07:56 +02:00
dm_event_systemd_red_hat.service.in dmeventd: fix dmeventd -R to work properly with systemd 2014-02-06 17:15:19 +01:00
dm_event_systemd_red_hat.socket.in systemd: use RemoveOnStop for dm-event.socket and lvm2-lvmetad.socket 2014-06-13 15:45:25 +02:00
fsadm.sh fsadm: avoid using -a in test 2014-07-02 10:45:41 +02:00
gdbinit RAID: Add writemostly/writebehind support for RAID1 2013-04-15 13:59:46 -05:00
lvm2_activation_generator_systemd_red_hat.c systemd: use umask 022 for generated systemd units by lvm2-activation-generator 2014-05-21 10:12:02 +02:00
lvm2_cluster_activation_red_hat.sh.in cleanup: clarify man pages about lvchange/vgchange -aay, use -aay in lvm2-cluster-activation script 2014-02-11 13:48:04 +01:00
lvm2_cluster_activation_systemd_red_hat.service.in systemd: do not use default dependencies for clvmd/cmirrord units 2014-02-14 14:37:19 +01:00
lvm2_clvmd_systemd_red_hat.service.in revert: 7639eae and 4a52a92 2014-11-20 08:22:34 +01:00
lvm2_cmirrord_systemd_red_hat.service.in revert: 7639eae and 4a52a92 2014-11-20 08:22:34 +01:00
lvm2_lvmetad_init_red_hat.in Remove pvscan --cache from lvm2-lvmetad init script. 2012-10-15 12:58:23 +02:00
lvm2_lvmetad_systemd_red_hat.service.in systemd: cleanup for lvmetad systemd unit 2014-02-10 16:20:45 +01:00
lvm2_lvmetad_systemd_red_hat.socket.in systemd: use RemoveOnStop for dm-event.socket and lvm2-lvmetad.socket 2014-06-13 15:45:25 +02:00
lvm2_monitoring_init_red_hat.in scripts: use --ignoreskippedcluster in lvm2-monitor initscript/systemd unit 2014-02-17 16:29:49 +01:00
lvm2_monitoring_init_rhel4 Use also normalized output for vgchange command in lvm2-monitor init script. 2011-12-16 11:42:56 +00:00
lvm2_monitoring_systemd_red_hat.service.in systemd: remove workaround for lvm2-monitor.service's ExecStop line 2014-10-14 10:08:23 +02:00
lvm2_pvscan_systemd_red_hat@.service.in systemd: use lvm binary insetad of command symlink in lvm2-pvscan.service 2014-04-30 15:21:25 +02:00
lvm2_tmpfiles_red_hat.conf.in Use 'd' instead of 'D' in tmpfiles configuration to not overwrite any existing directory. 2012-02-23 14:24:30 +00:00
lvmconf_lockingtype2.sh Use /bin/bash for scripts with bashisms 2010-05-14 11:33:20 +00:00
lvmconf.sh lvmconf: use_lvmetad=0 on --enable-cluster, reset to default on --disable-cluster 2013-09-24 14:03:42 +02:00
lvmdump.sh lvmdump: list also inactive units for lvmdump -s 2014-04-15 15:43:20 +02:00
Makefile.in systemd: install lvm2-cluster-activation script as executable 2014-05-21 09:45:29 +02:00
relpath.awk Fix scripts/relpath.awk to work with mawk 2010-05-21 15:28:16 +00:00
vg_convert change two files in different directories 2006-06-06 17:44:11 +00:00
vgimportclone.sh vgimportclone: also notify lvmetad about changes if it's used 2014-12-10 14:00:56 +01:00
VolumeGroup.ocf Add OCF support 2010-11-05 16:18:38 +00:00