I'm trying to make use of lvm thin volumes on Trusty 14.04 with an external drive of 3TB as the PV for the volumegroup, but for some reason this fails and the thinpool gets somehow corrupted.
On a 2TB drive as the PV this all works fine and I can even create thin snapshots of the thin volumes etc.
Here's what I've done:
1) Setup the PV:
# pvcreate /dev/sdb
2) Create the volume group:
# vgcreate vg_backups /dev/sdb
3) Create the thinpool:
# lvcreate --thin -L2,5T --chunksize 1M --poolmetadatasize 16G /dev/vg_backups/backup_thinpool
4) Create a new thin volume:
# lvcreate --thinpool /dev/vg_backups/backup_thinpool -n test_lv -V400G
5) So far everything seems to go fine and the thin LV seems to be active but when I want to make the VG inactive with:
# vgchange -an /dev/vg_backups
...I first get this warning:
WARNING: Integrity check of metadata for thin pool vg_backups/backup_thinpool failed.
Then if I try to re-activate the VG by:
# vgchange -ay /dev/vg_backups
Check of thin pool vg_backups/backup_thinpool failed (status:1). Manual repair required (thin_dump --repair /dev/mapper/vg_backups-backup_thinpool_tmeta)!
... and the thin volume cannot be activated. Running the thin_dump --repair command just gives:
# thin_dump --repair /dev/mapper/vg_backups-backup_thinpool_tmeta read failed
And as I said, it all works if I use a 2TB drive as the PV. Also tested on a Centos 7 box and there it also works with the 3TB drive. So, something must be wrong with the lvm thinpool handling in Ubuntu.
Has anyone run in to this issue? Any workarounds / fixes available?
Some further testing and findings:
I have another machine with 16.04 now installed (same results as on 15.10 btw) where I'm actually able to create the thin LV on the 3T disk and it gets activated and is usable.
However, if I make a thin snapshot of the thin volume like this:
# lvcreate -s --thinpool /dev/vg_backups/backup_thinpool -n test_lv_snapshot test_lv
...then that thin snapshot won't become active and I cannot activate it even if I try:
# lvchange -ay /dev/vg_backups/test_lv_snapshot
I don't get any errors, the LV just doesn't become active.
On 16.04 I can deactivate and reactivate (vgchange) the volume group without errors -just the thin snapshots won't become active no matter what I try.
Also on 16.04 (and 15.10) even the 2T disk has the same behaviour -the thin snapshots won't become active.
However, if I first create the thinpool, some thin volumes and some thin snapshots of those thin volumes on the 2T disk on the 14.04 machine and then attach the disk to the 16.04 machine then those thin volumes and their snapshots are activated.
But if I then make some more thin snapshots on that disk on the 16.04 machine those thin snapshots cannot be activated on the 16.04 machine but if I attach the disk back to the 14.04 machine even the thin snapshots created on the 16.04 machine are seen as active...???
So, I see possibly two separate problems here:
1) Somehow 14.04 cannot handle the 3T disk as it does the 2T disk
2) Thin snapshots on any disk created on 16.04 cannot be activated
This means that any thin snapshots created on 16.04 (and 15.10) cannot be accessed (cannot activate and mount the volumes) which is very bad!
So, if anyone has solutions to these issues that would be great!