Bug#833790: lvm2: behevaiour change: lvremove on cached device removed origin device, potential data loss

Bastian Blank waldi at debian.org
Mon Aug 8 18:01:13 UTC 2016


Control: tags -1 unreproducible
Control: severity -1 important

On Mon, Aug 08, 2016 at 06:22:17PM +0200, Marc Lehmann wrote:
> After upgrading, the manpage didn't change, but the behaviour changed:
> now lvremove removes the origin device as well, while lvconvert --uncache
> works as before.

I can't reproduce this:

Setup:

|# lvcreate --type cache-pool -n test_cache -L 1G vg
|  Logical volume "test_cache" created.
|# lvcreate --cache -n vg/test -L 1G --cachepool vg/test_cache vg
|  Logical volume "test" created.
|# lvs --all
|  LV                 VG Attr       LSize   Pool         Origin Data%  Meta%  Move Log Cpy%Sync Convert
|  test               vg Cwi-a-C---   1,00g [test_cache]        0,00                   100,00
|  [test_cache]       vg Cwi---C---   1,00g
|  [test_cache_cdata] vg Cwi-ao----   1,00g
|  [test_cache_cmeta] vg ewi-ao----   1,00g
|  [test_corig]       vg owi-aoC---   1,00g

Removing the target volume "test" removes everything:

|# lvremove vg0_devel/test
|Do you really want to remove active logical volume vg0_devel/test? [y/n]: y
|  Logical volume "test_cache" successfully removed
|  Logical volume "test" successfully removed

However, as document, removing the cache-volume only removes the cache
itself, not the origin:

|# lvremove vg/test_cache
|  Logical volume "test_cache" successfully removed
|# lvs --all
|  LV               VG Attr       LSize   Pool     Origin Data%  Meta%  Move Log Cpy%Sync Convert
|  test             vg -wi-a-----   1,00g

> This is a rather unexpected and dangerous behaviour change. While
> normally, these actions could be undone with vgcfgrestore, I have discard
> enabled in my lvm2.conf, which cannot be undone. (By sheer luck did I not
> lose any data, because I wanted to decomission the volume anyway).

There is a reason why discard is of by default.

Bastian

-- 
Immortality consists largely of boredom.
		-- Zefrem Cochrane, "Metamorphosis", stardate 3219.8



More information about the pkg-lvm-maintainers mailing list