Watching the sausage being made: lvm and duplicate PV

| | Comments (0)
I ran vgs across all the servers and saw a warning like this:

Found duplicate PV QeHF8dKmUSAHDDdpyreQUQ0i93hRPDJK: using /dev/sde2 not /dev/md1

It was a scary message but ultimately turned out to be a false alarm.

This script will show whether any LVM's are mounted directly on a hard drive and not an md device:

for i in $(ls -d /sys/block/sd?); do
for j in $(ls -d $i/sd*); do
echo $j:$(ls $j/holders);
done;
done;

Any results containing "dm" are Bad. Fortunately there were no servers where this was unexpectedly true.

It turns out that setting

md_component_detection = 1

in /etc/lvm/lvm.conf is not sufficient to avoid scanning the hard drives.

For one thing, in the highly unlikely case there's a problem with the md component filter it will not cause lvm to fail. For another, if the lvm cache in
/etc/lvm/cache/.cache contains hard drives it appears that they will still be scanned.

To completely fix, first change the "filter" line in /etc/lvm/lvm.conf to be

filter = [ "a|/dev/md|", "r|.*|" ]

and then remove or move /etc/lvm/cache/.cache .

Leave a comment

About this Entry

This page contains a single entry by srn published on October 10, 2014 3:09 PM.

XSA-108 was the previous entry in this blog.

Guests rebooting tonight (10/13) may shut down instead is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.