[linux-lvm] unexpected behaviour of "lvresize" with sparse volumes
zdenek.kabelac at gmail.com
Thu Oct 15 09:24:39 UTC 2015
Dne 15.10.2015 v 09:13 Alexey napsal(a):
> If you look at the output of `lvs myvg`, then you will understand whats happens.
> When you create thin LV without specifying option `-T`, lvm automatically
> created TP for you with size equal to -L option.
> And when you resize your sparsevol, your TP (auto name lvol1) still have old
Mixing 2 things together.
Newer lvm2 tools (then reported 2.02.98) are now creating sparse volumes
as a thin volume in thin-pool.
Old behavior with /dev/zero snapshot is thought still available
either with lvm.conf settings or using --type snapshot.
Now back to the original problem - yep you cannot resize it with tool ATM.
There will be likely added support for 'lvresize -V+'
(it will work for thin volumes & these sparse snapshot)
Basically adding 'virtual size'.
But it has lower priority ATM (as you may resize thin volumes
with -L, and thus users do not have much troubles with it,
expect the logical meaning looks 'wrong' - as resize of thin
volume does not really 'eat' extents from VG.
If you 'urgently' need bigger size -
- make sure modified LVs are rather deactivated.
- 'vgcfgbackup' your vg
- take your favourite text editor (e.g. vi)
- edit size for your '_vorigin' LV (extent_count = ....)
- edit size for respective hidden 'snapshot0' LV (extent_count = ....)
(if you have more then one -
find properly numbered one, the one referencing your _vorigin! -
those 2 LVs should have equal size)
- 'vgcfgrestore' your updated metadata
- activate now bigger sized _vorigin
- check blockdev --getsize64 /dev/vg/sparsevol has new correct size
More information about the linux-lvm