All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Proper way to delete an active snapshot?
@ 2011-08-30 11:32 Linda A. Walsh
  2011-08-30 11:47 ` Zdenek Kabelac
  2011-08-30 18:18 ` Stuart D. Gathman
  0 siblings, 2 replies; 6+ messages in thread
From: Linda A. Walsh @ 2011-08-30 11:32 UTC (permalink / raw)
  To: LVM general discussion and development




If you have a snapshot of a volume running... how are you supposed to delete
it?

i.e. after you unmount it... if I just do a lvremove, I get a warning 
about it being
an active volume -- so I tried doing a dmsetup remove on it first -- and 
that
stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
volume names under 'dmsetup ls', that referred to the old snapshot names.

so I'm guessing that using dmsetup to remove the dev first, then lvremove is
NOT the best way to be doing this...(as it results in stuff that needs 
to be cleaned
up...)... 

So how do I remove the volume w/o getting warnings about it being 'active'?

(Unless, of course it is still mounted or something lame like that -- I 
mean I want
a warning to actually mean something...otherwise I start ignoring them, 
which is bad
(at least for me..)).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Proper way to delete an active snapshot?
  2011-08-30 11:32 [linux-lvm] Proper way to delete an active snapshot? Linda A. Walsh
@ 2011-08-30 11:47 ` Zdenek Kabelac
  2011-08-30 12:02   ` Zdenek Kabelac
  2011-08-30 18:18 ` Stuart D. Gathman
  1 sibling, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2011-08-30 11:47 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Linda A. Walsh

Dne 30.8.2011 13:32, Linda A. Walsh napsal(a):
> 
> 
> 
> If you have a snapshot of a volume running... how are you supposed to delete
> it?
> 
> i.e. after you unmount it... if I just do a lvremove, I get a warning about it
> being
> an active volume -- so I tried doing a dmsetup remove on it first -- and that
> stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
> volume names under 'dmsetup ls', that referred to the old snapshot names.


lvchange -an  vg/snapshot_lv

Does it work for you ?

If so - please post  -vvvv  trace.

Zdenek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Proper way to delete an active snapshot?
  2011-08-30 11:47 ` Zdenek Kabelac
@ 2011-08-30 12:02   ` Zdenek Kabelac
  2011-09-03  7:48     ` Linda A. Walsh
  0 siblings, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2011-08-30 12:02 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Linda A. Walsh

Dne 30.8.2011 13:47, Zdenek Kabelac napsal(a):
> Dne 30.8.2011 13:32, Linda A. Walsh napsal(a):
>>
>>
>>
>> If you have a snapshot of a volume running... how are you supposed to delete
>> it?
>>
>> i.e. after you unmount it... if I just do a lvremove, I get a warning about it
>> being
>> an active volume -- so I tried doing a dmsetup remove on it first -- and that
>> stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
>> volume names under 'dmsetup ls', that referred to the old snapshot names.
> 
> 
> lvchange -an  vg/snapshot_lv

Ooops sorry - ignore this one - as this will work with some not yet release target

> 
> Does it work for you ?
> 
> If so - please post  -vvvv  trace.


So just post only  lvremove -vvvv  trace please.

It could be udev-related issue.

Zdenek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Proper way to delete an active snapshot?
  2011-08-30 11:32 [linux-lvm] Proper way to delete an active snapshot? Linda A. Walsh
  2011-08-30 11:47 ` Zdenek Kabelac
@ 2011-08-30 18:18 ` Stuart D. Gathman
  2011-09-03  8:23   ` Linda A. Walsh
  1 sibling, 1 reply; 6+ messages in thread
From: Stuart D. Gathman @ 2011-08-30 18:18 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, 30 Aug 2011, Linda A. Walsh wrote:

> If you have a snapshot of a volume running... how are you supposed to delete
> it?
>
> i.e. after you unmount it... if I just do a lvremove, I get a warning about 
> it being
> an active volume -- so I tried doing a dmsetup remove on it first -- and that
> stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
> volume names under 'dmsetup ls', that referred to the old snapshot names.
>
> so I'm guessing that using dmsetup to remove the dev first, then lvremove is
> NOT the best way to be doing this...(as it results in stuff that needs to be 
> cleaned
> up...)... 
> So how do I remove the volume w/o getting warnings about it being 'active'?

I agree that the warning is broken (when LV is not otherwise mounted or open).

I use

   /usr/sbin/lvremove  -f "$snappath"

in scripts, which suppresses the warning without leaving a mess.  I'm not
sure what happens if the LV is actually open in that case.  Hopefully
you get an error.

I am on Centos-5.6

--
 	      Stuart D. Gathman <stuart@bmsi.com>
     Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Proper way to delete an active snapshot?
  2011-08-30 12:02   ` Zdenek Kabelac
@ 2011-09-03  7:48     ` Linda A. Walsh
  0 siblings, 0 replies; 6+ messages in thread
From: Linda A. Walsh @ 2011-09-03  7:48 UTC (permalink / raw)
  To: LVM general discussion and development



Zdenek Kabelac wrote:
> Dne 30.8.2011 13:47, Zdenek Kabelac napsal(a):
>   
>> Dne 30.8.2011 13:32, Linda A. Walsh napsal(a):
>>     
>>>
>>> If you have a snapshot of a volume running... how are you supposed to delete
>>> it?
>>>
>>> i.e. after you unmount it... if I just do a lvremove, I get a warning about it
>>> being
>>> an active volume -- so I tried doing a dmsetup remove on it first -- and that
>>> stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
>>> volume names under 'dmsetup ls', that referred to the old snapshot names.
>>>       
>> lvchange -an  vg/snapshot_lv
>>     
>
> Ooops sorry - ignore this one - as this will work with some not yet release target
>
>   
I'm confused.

First I tried:

# lvremove /dev/Home+Space/Home-2011.08.31-02.23.11
Do you really want to remove active logical volume 
Home-2011.08.31-02.23.11? [y/n]: ^C
  Logical volume Home-2011.08.31-02.23.11 not removed


Then, I tried what you had above:

# lvchange -an /dev/Home+Space/Home-2011.08.31-02.23.11     
# lvremove /dev/Home+Space/Home-2011.08.31-02.23.11    
  Logical volume "Home-2011.08.31-02.23.11" successfully removed

Was it not supposed to work?



>> Does it work for you ?
>>
>> If so - please post  -vvvv  trace.
>>     
>
>
> So just post only  lvremove -vvvv  trace please.
>
> It could be udev-related issue.
>
> Zdenek
>
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>   

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Proper way to delete an active snapshot?
  2011-08-30 18:18 ` Stuart D. Gathman
@ 2011-09-03  8:23   ` Linda A. Walsh
  0 siblings, 0 replies; 6+ messages in thread
From: Linda A. Walsh @ 2011-09-03  8:23 UTC (permalink / raw)
  To: LVM general discussion and development



Stuart D. Gathman wrote:
> On Tue, 30 Aug 2011, Linda A. Walsh wrote:
>
>> If you have a snapshot of a volume running... how are you supposed to 
>> delete
>> it?
>>
>> i.e. after you unmount it... if I just do a lvremove, I get a warning 
>> about it being
>> an active volume -- so I tried doing a dmsetup remove on it first -- 
>> and that
>> stops the warning -- but I just noticed, I had a bunch of inactive 'cow'
>> volume names under 'dmsetup ls', that referred to the old snapshot 
>> names.
>>
>> so I'm guessing that using dmsetup to remove the dev first, then 
>> lvremove is
>> NOT the best way to be doing this...(as it results in stuff that 
>> needs to be cleaned
>> up...)... So how do I remove the volume w/o getting warnings about it 
>> being 'active'?
>
> I agree that the warning is broken (when LV is not otherwise mounted 
> or open).
>
> I use
>
>   /usr/sbin/lvremove  -f "$snappath"
---
    Yeah...done that... doesn't feel right
>
> in scripts, which suppresses the warning without leaving a mess.  I'm not
> sure what happens if the LV is actually open in that case.  Hopefully
> you get an error.
Well...
I wouldn't expect that ... ... seems like -f could be for overcoming a
stuck driver -- in which case it might ignore a 'mounted' signal
from the kernel...  So that's why I asked...



The odd thing -- I used lvchange -- but it wasn't a mirrored or active 
volume..

I had:
   ....
  Home-2011.08.23-18.00.56 Home+Space -wi-ao   6.49g
  Home-2011.08.25-02.13.58 Home+Space -wi-ao   4.07g  
 *Home-2011.08.31-02.23.11 Home+Space -wi-a- 888.00m 
  Home-2011.08.31-07.34.53 Home+Space -wi-a-   1.86g
---
The one I removed was the one with the * beside it...
The one from yesterday morning didn't get filled up and mounted
either...but I still have the diff (maybe I copy it off manually..
rather than trust it to another run of my shell
script from hell..(what started out as a fun project has turned
into a personal demon!)...


;-')

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-03  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-30 11:32 [linux-lvm] Proper way to delete an active snapshot? Linda A. Walsh
2011-08-30 11:47 ` Zdenek Kabelac
2011-08-30 12:02   ` Zdenek Kabelac
2011-09-03  7:48     ` Linda A. Walsh
2011-08-30 18:18 ` Stuart D. Gathman
2011-09-03  8:23   ` Linda A. Walsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.