[lvm-devel] lvmcache lv destroy with no flush

Zdenek Kabelac zkabelac at redhat.com
Fri Aug 2 13:50:56 UTC 2019


Dne 02. 08. 19 v 15:45 Lakshmi Narasimhan Sundararajan napsal(a):
> Hi Zdenek,
> 
> Thank you for your email.
> 
>   * If you know you are going to destroy whole VG - you can simply make sure,
>   * there is no running  LV - and just recreate  PV/VG from scratch - certainly
>   * faster them removing i.e.  thousand of LVs individually one-by-one which
>   * is what will happen with lvremove/vgremove command ATM.
> 
> I tried to follow you for accelerated removal… did I interpret you correctly? 
> I though hit the cache sync stuck issue. Please clarify what needs to change 
> below. I see still cache flush happens while removing the vg.
> 
> myhome$ sudo vgcreate pxtest /dev/sdc /dev/nvme0n1
> 
>    Volume group "pxtest" successfully created
> 
> myhome$
> 
> myhome$ sudo lvcreate -n cache --type cache-pool -l 100%pvs pxtest /dev/nvme0n1
> 
>    Logical volume "cache" created.
> 
> myhome$ sudo lvcreate -n pool --type cache --cachepool pxtest/cache -l 100%pvs 
> pxtest /dev/sdc
> 
>    Logical volume "pool" created.
> 
> Myhome$
> 
> myhome$ sudo lvs pxtest
> 
>    LV   VG     Attr       LSize  Pool    Origin       Data%  Meta%  Move Log 
> Cpy%Sync Convert
> 
>    pool pxtest Cwi---C--- 10.00g [cache] [pool_corig]
> 
> myhome$
> 
> myhome$ sudo vgchange -an pxtest
> 
>    0 logical volume(s) in volume group "pxtest" now active
> 
> myhome$ sudo vgremove -ff pxtest
> 
>    4096 blocks must still be flushed.
> 
>    4096 blocks must still be flushed.
> 
>    4096 blocks must still be flushed.
> 
>    4096 blocks must still be flushed.
> 
> ^C
> 

1.) remove devices from DM table
dmsetup remove_all
(or just some selected device - whatever fits...)

2.) remove disk singatures of VG
wipefs -a /dev/sdc
wipefs -a /dev/nvme0n1
(or pvremove -ff /dev/sdc /dev/nvme0n1)

3.) recreate empty VG from scratch
vgcreate pxtest /dev/sdc /dev/nvme0n1


Although I'm not quite sure this is what you really want :) - it's more or 
less idea for quicker testing - not something for presering data.


Regards

Zdenek




More information about the lvm-devel mailing list