1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
Peter Rajnoha d97f1c89de metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed
If we know that the PV is orphan, meaning there's at least one MDA on
that PV which does not reference any VG and at the same time there's
PV_EXT_USED flag set, we're certainly in an inconsistent state and we
need to fix this.

For example, such situation can happen during vgremove/vgreduce if we
removed/reduced the VG, but we haven't written PV headers yet because
vgremove stopped abruptly for whatever reason just before writing new
PV headers with updated state, including PV extension flags (and so the
PV_EXT_USED flag).

However, in case the PV has no MDAs at all, we can't double-check
whether the PV_EXT_USED is correct or not - if that PV is marked
as used, it's either:
  - really used (but other disks with MDAs are missing)
  - or the error state as described above is hit

User needs to overwrite the PV header directly if it's really clear
the PV having no MDAs does not belong to any VG and at the same time
it's still marked as being in use (pvcreate -ff <dev_name> will fix this).

For example - /dev/sda here has 1 MDA, orphan and is incorrectly marked
with PV_EXT_USED flag:

$ pvs --binary -o+pv_in_use
  WARNING: Found inconsistent standalone Physical Volumes.
  WARNING: Repairing flag incorrectly marking Physical Volume /dev/sda as used.
  PV         VG     Fmt  Attr PSize   PFree   InUse
  /dev/sda          lvm2 ---  128.00m 128.00m     0
2016-02-15 12:44:46 +01:00
autoconf autoconf: Update config.guess/sub to 2014-01-01. 2014-01-21 22:00:15 +00:00
conf conf: add metadata/check_pv_device_sizes 2016-01-22 14:16:00 +01:00
coverity doc: change fsf address 2016-01-21 12:11:37 +01:00
daemons lvmlockd: don't adopt locks from unused lm 2016-01-28 09:42:45 -06:00
doc doc: change fsf address 2016-01-21 12:11:37 +01:00
include doc: change fsf address 2016-01-21 12:11:37 +01:00
lib metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed 2016-02-15 12:44:46 +01:00
libdaemon doc: change fsf address 2016-01-21 12:11:37 +01:00
libdm dm: alloc always 8byte aligned 2016-02-11 18:35:05 +01:00
liblvm doc: change fsf address 2016-01-21 12:11:37 +01:00
man man: pvresize: remove old comment about inability to resize PV with more mdas 2016-02-12 16:29:47 +01:00
nix lockd: Clean up spec 2015-07-04 14:36:57 +02:00
old-tests doc: change fsf address 2016-01-21 12:11:37 +01:00
po doc: change fsf address 2016-01-21 12:11:37 +01:00
python doc: change fsf address 2016-01-21 12:11:37 +01:00
report-generators doc: change fsf address 2016-01-21 12:11:37 +01:00
reports [REPORT-GENERATORS] cut down stylsheet.css to what we actually use 2010-07-21 10:00:38 +00:00
scripts vgimportclone: fix VG name variable reference in error message after failed PV uuid change 2016-01-21 14:47:48 +01:00
spec doc: change fsf address 2016-01-21 12:11:37 +01:00
test man: pvresize: remove old comment about inability to resize PV with more mdas 2016-02-12 16:29:47 +01:00
tools metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed 2016-02-15 12:44:46 +01:00
udev doc: change fsf address 2016-01-21 12:11:37 +01:00
unit-tests doc: change fsf address 2016-01-21 12:11:37 +01:00
.gitignore gitignore: Update for in-place build. 2015-07-27 13:18:35 +01:00
acinclude.m4 configure: detect st_ctim 2015-03-18 13:42:24 +01:00
aclocal.m4 doc: change fsf address 2016-01-21 12:11:37 +01:00
configure configure: fix configure to set proper use_blkid_wiping if autodetected as disabled 2016-01-21 10:01:34 +01:00
configure.in doc: change fsf address 2016-01-21 12:11:37 +01:00
COPYING doc: change fsf address 2016-01-21 12:11:37 +01:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in doc: change fsf address 2016-01-21 12:11:37 +01:00
Makefile.in doc: change fsf address 2016-01-21 12:11:37 +01:00
README README: fix link to lvm-devel mailing list 2015-03-31 15:44:00 +02:00
VERSION post-release 2016-02-15 10:48:55 +00:00
VERSION_DM post-release 2016-02-15 10:48:55 +00:00
WHATS_NEW post-release 2016-02-15 10:48:55 +00:00
WHATS_NEW_DM post-release 2016-02-15 10:48:55 +00:00

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.