Let's say you have created a snapshot, you have used it and now you want to remove it.
What you can do if you get the following message?
core:~# lvscan | grep mylv ACTIVE Original '/dev/datavg/mylv' [2.00 GiB] inherit ACTIVE Snapshot '/dev/datavg/snapmylv' [1.00 GiB] inherit core:~# lvremove -f /dev/datavg/snapmylv [color=red]Can't remove open logical volume "snapmylv"[/color]
One way is to ask dmsetup
for help:
core:~# [color=green]dmsetup -f remove /dev/mapper/datavg-snapmylv[/color] core:~# [color=green]dmsetup -f remove /dev/mapper/datavg-snapmylv-cow[/color] core:~# [color=green]lvremove -f /dev/datavg/snapmylv[/color] Logical volume "snapmylv" successfully removed core:~# lvscan | grep mylv ACTIVE '/dev/datavg/mylv' [2.00 GiB] inherit