PV corruption: allocated PE > total PE
Ive just noticed that one of my PVs has more allocated PE's than the total available, leading to a negative amount of free space:
vrumpet root # pvdisplay -d /dev/hda5
--- Physical volume ---
PV Name /dev/hda5 VG Name myvg PV Size 11.72 GB / not usable 33.65 MB Allocatable yes PE Size (KByte) 32768 Total PE 374 Free PE 4294967278 Allocated PE 392 PV UUID TXK2VM-UWdP-dMbY-yz4c-Nq3b-GM32-B56udb
This is on a gentoo linux system, kernel 2.6.6. The latest LVM userland in gentoo is 2.00.08, I havent tried anything more recent, but there doesnt seem anything relevant in the change log. These VGs were originally created using LVM1 on a 2.4 kernel.
Any suggestions?
Thanks in advance,
Quoted 6 lines · Toby Dickenson
Ive just noticed that one of my PVs has more allocated PE's than the total available, leading to a negative amount of free space:
This is on a gentoo linux system, kernel 2.6.6. The latest LVM userland in gentoo is 2.00.08, I havent tried anything more recent, but there doesnt seem anything relevant in the change log.
Definitely try the latest version: there've been a few related fixes. (With lvm1 on-disk format, may need to backup restore/metadata if it's wrong on disk.)
Alasdair
Signature · 1 line
[email protected]
Quoted 9 lines · Alasdair G Kergon
Quoted 6 lines · Toby Dickenson
Ive just noticed that one of my PVs has more allocated PE's than the total available, leading to a negative amount of free space:
This is on a gentoo linux system, kernel 2.6.6. The latest LVM userland in gentoo is 2.00.08, I havent tried anything more recent, but there doesnt seem anything relevant in the change log.
Definitely try the latest version: there've been a few related fixes.
OK, I'm on lvm .25 and device mapper .19.
I removed the newest LV in that PV, then rebooted. Everything looked right, and the metadata backup was as I expected. However using lvcreate again to create a sufficiently large LV (large enough to fill this PV plus a bit more) recreated the original problem in pvdisplay's output.
Quoted 2 lines
(With lvm1 on-disk format, may need to backup restore/metadata if it's wrong on disk.)
The following values all seem to be consistent:
* pvdisplay 'Total PE'
* pe_count in /etc/lvm/backup/
* the total of the relevant 'extent_count' fields in /etc/lvm/backup/
But the value reported by pvdisplay 'Allocated PE' is too large. Where does pvdisplay get that value from? Do I need to worry about data corruption, or could this be just a display formatting bug?
I still can't reproduce this.
Please do a metadata backup/restore using 2.00.25 to make sure the on-disk metadata is correct, then try again.
If it still goes wrong, please send me your /etc/lvm directory to investigate.
Alasdair
Signature · 1 line
[email protected]