15.10: pvs/pvscan/pvdisplay not recognising PV metadata when lvmetad is running
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Working on a 14.04 amd64 host with a 15.10 chroot I found that several PV tools cannot recognise PVs created on 14.04.
As a test on 14.04 I created 2 test loop device files and used pvcreate on them (loop0 has zero metadata copies).
## In 14.04:
$ sudo losetup -vf /var/lib/
Loop device is /dev/loop0
$ sudo losetup -vf /var/lib/
Loop device is /dev/loop1
$ sudo losetup -a
/dev/loop0: [fc17]:2612 (/var/lib/
/dev/loop1: [fc17]:2613 (/var/lib/
$ file -s /dev/loop[0-1]
/dev/loop0: LVM2 PV (Linux Logical Volume Manager), UUID: t304eP-
/dev/loop1: LVM2 PV (Linux Logical Volume Manager), UUID: 6194QF-
$ blkid /dev/loop[0-1]
/dev/loop0: UUID="t304eP-
/dev/loop1: UUID="6194QF-
$ sudo pvck /dev/loop[0-1]
Found label on /dev/loop0, sector 0, type=LVM2 001
Found label on /dev/loop1, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
$ sudo pvs /dev/loop[0-1]
PV VG Fmt Attr PSize PFree
/dev/loop0 Test lvm2 a-- 1020.00m 1020.00m
/dev/loop1 Test lvm2 a-- 496.00m 496.00m
## In 15.10
# file -s /dev/loop[0-1]
/dev/loop0: LVM2 PV (Linux Logical Volume Manager), UUID: t304eP-
/dev/loop1: LVM2 PV (Linux Logical Volume Manager), UUID: 6194QF-
# blkid /dev/loop[0-1]
/dev/loop0: UUID="t304eP-
/dev/loop1: UUID="6194QF-
# pvck /dev/loop[0-1]
Found label on /dev/loop0, sector 0, type=LVM2 001
Found label on /dev/loop1, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
# pvs /dev/loop[0-1]
Failed to find physical volume "/dev/loop0".
Failed to find physical volume "/dev/loop1".
## In the 15.10 chroot I created another loop device file and used pvcreate on it.
# losetup -vf /var/lib/
# losetup -a
/dev/loop0: [64535]:2612 (/var/lib/
/dev/loop1: [64535]:2613 (/var/lib/
/dev/loop2: [64535]:1056349 (/var/lib/
# file -s /dev/loop2
/dev/loop2: LVM2 PV (Linux Logical Volume Manager), UUID: 7auwAs-
# blkid /dev/loop2
/dev/loop2: UUID="7auwAs-
# pvck /dev/loop2
Found label on /dev/loop2, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
# pvs /dev/loop2
PV VG Fmt Attr PSize PFree
/dev/loop2 lvm2 --- 600.00m 600.00m
## In the 14.04 host
$ sudo losetup -a
/dev/loop0: [fc17]:2612 (/var/lib/
/dev/loop1: [fc17]:2613 (/var/lib/
/dev/loop2: [fc17]:1056349 (/var/lib/
$ file -s /dev/loop2
/dev/loop2: LVM2 PV (Linux Logical Volume Manager), UUID: 7auwAs-
$ blkid /dev/loop2
/dev/loop2: UUID="7auwAs-
$ sudo pvck /dev/loop2
Found label on /dev/loop2, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
$ sudo pvs /dev/loop2
PV VG Fmt Attr PSize PFree
/dev/loop2 lvm2 a-- 600.00m 600.00m
## 14.04
apt-cache policy lvm2
lvm2:
Installed: 2.02.98-6ubuntu2
Candidate: 2.02.98-6ubuntu2
Version table:
*** 2.02.98-6ubuntu2 0
500 http://
100 /var/lib/
## 15.10
# apt-cache policy lvm2
lvm2:
Installed: 2.02.122-1ubuntu1
Candidate: 2.02.122-1ubuntu1
Version table:
*** 2.02.122-1ubuntu1 0
500 http://
100 /var/lib/
summary: |
- 15.10: pvs/pvscan/pvdisplay not recognising PV metadata created by 14.04 + 15.10: pvs/pvscan/pvdisplay not recognising PV metadata when lvmetad is + running |
Changed in lvm2 (Ubuntu): | |
status: | New → Triaged |
Workaround is:
service lvm2-lvmetad stop
Problem is that lvmetad is designed to cache device metadata on discovery, which (should) come from specialised udevd rules. In the chroot there is no init/udevd running so even re-attaching the loop devices doesn't cause the PVs to be scanned.
There is a RedHat mailing list reference to this issue at:
http:// www.redhat. com/archives/ linux-lvm/ 2014-October/ msg00043. html