1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/device
David Teigland beb229e1e8 devices: improve handling of duplicate PVs
Example:

/dev/loop0 and /dev/loop1 are duplicates,
created by copying one backing file to the
other.

'identity /dev/loopX' creates an identity
mapping for loopX named idmloopX, which
adds a duplicate for the named device.

The duplicate selection code for lvmetad is
incomplete, and lvmetad is disabled for this
example.

[~]# losetup -f loopfile0
[~]# pvs
  PV         VG           Fmt  Attr PSize   PFree
  /dev/loop0 foo          lvm2 a--  308.00m 296.00m

[~]# losetup -f loopfile1
[~]# pvs
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 which is more recent, replacing /dev/loop0
  PV         VG           Fmt  Attr PSize   PFree
  /dev/loop1 foo          lvm2 a--  308.00m 308.00m

[~]# ./identity /dev/loop0
[~]# pvs
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 without holders, replacing /dev/loop0
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop0 not /dev/loop1
  Using duplicate PV /dev/mapper/idmloop0 from subsystem DM, replacing /dev/loop1
  PV                   VG           Fmt  Attr PSize   PFree
  /dev/mapper/idmloop0 foo          lvm2 a--  308.00m 296.00m

[~]# ./identity /dev/loop1
[~]# pvs
  WARNING: duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV is being used from both devices /dev/loop0 and /dev/loop1
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 which is more recent, replacing /dev/loop0
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop0 not /dev/loop1
  Using duplicate PV /dev/mapper/idmloop0 from subsystem DM, replacing /dev/loop1
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop1 not /dev/mapper/idmloop0
  Using duplicate PV /dev/mapper/idmloop1 which is more recent, replacing /dev/mapper/idmloop0
  PV                   VG           Fmt  Attr PSize   PFree
  /dev/mapper/idmloop1 foo          lvm2 a--  308.00m 308.00m
2015-04-28 10:41:32 -05:00
..
dev-cache.c pvscan: check sysfs dev entry before rescan 2015-03-18 16:19:58 +01:00
dev-cache.h report: select: refactor: move str_list to libdm 2014-06-17 16:27:20 +02:00
dev-ext-udev-constants.h cleanup: add dev-ext-udev-constants.h with constants/names of the properties/values used from udev db 2015-01-30 13:17:12 +01:00
dev-ext.c device: add infrastructure to support external device info 2015-01-30 13:01:12 +01:00
dev-io.c devices: avoid extra open() syscall 2015-03-06 13:17:39 +01:00
dev-luks.c device: cleanup signature wiping functions 2013-11-27 12:56:58 +01:00
dev-md.c cleanup: add dev-ext-udev-constants.h with constants/names of the properties/values used from udev db 2015-01-30 13:17:12 +01:00
dev-swap.c dev-swap: use SECTOR_SHIFT 2014-03-22 20:43:05 +01:00
dev-type.c devices: improve handling of duplicate PVs 2015-04-28 10:41:32 -05:00
dev-type.h filters: no need to refresh filters/rescan if no signature is wiped during pvcreate at all 2015-02-17 09:46:34 +01:00
device-types.h cleanup: reorder commonly available devs in system to the front 2014-02-24 21:13:35 +01:00
device.h devices: avoid extra open() syscall 2015-03-06 13:17:39 +01:00