Discussion:
[linux-lvm] Reattach cache
Xen
2017-11-22 08:55:24 UTC
Permalink
Ehm,

When you split a cache and later reattach it, LVM ensures it is in a
consistent state right?

LVM is a bit old, I mean Ubuntu 16.04 version, so something about 133.
matthew patton
2017-11-22 09:16:48 UTC
Permalink
by definition when you detach a cache it is now entirely invalid and will (should) be treated as empty.
Xen
2017-11-22 10:53:26 UTC
Permalink
Post by matthew patton
by definition when you detach a cache it is now entirely invalid and
will (should) be treated as empty.
Yeah but it wasn't.

Within seconds the rootfs was readonly and because I was running some
apt thing at the same time, now a large bunch of packages became
corrupted in the apt index (dpkg index).

A bunch are still missing md5 files but I am on limited bandwidth so not
reinstalling.

So I assumed the above that you write.

But it bit me once more.
Zdenek Kabelac
2017-11-22 09:57:57 UTC
Permalink
Post by Xen
Ehm,
When you split a cache and later reattach it, LVM ensures it is in a
consistent state right?
LVM is a bit old, I mean Ubuntu 16.04 version, so something about 133.
Hi

Sorry but version 133 is really ancient - the original purpose of 'cache'
--splitcache was rather more debug oriented.

Clearing of cache-pool metadata when cache-pool is reattached to another LV
goes with version 2.02.162 - so your version is way too old...

In your case - just destroy the cache (--uncache) and do not try to reuse
cache-pool unless you really know what you are doing.

Regards

Zdenek
Xen
2017-11-22 10:15:12 UTC
Permalink
Post by Zdenek Kabelac
In your case - just destroy the cache (--uncache) and do not try to
reuse cache-pool unless you really know what you are doing.
But I still don't know how to clean the metadata manually.
Zdenek Kabelac
2017-11-22 11:03:16 UTC
Permalink
Post by Xen
Post by Zdenek Kabelac
In your case - just destroy the cache (--uncache) and do not try to
reuse cache-pool unless you really know what you are doing.
But I still don't know how to clean the metadata manually.
Just drop/lvremove the cache-pool and create the new one again.
There is no specific 'zeroing' metadata command.

And as said - newer tool will ZERO by default and you need to pass -Zn to
avoid zeroing (in case you want to reattach same cache-pool to unused data -
but as said you need to be skilled user knowing what you are doing for this
use case)

Zdenek

Loading...