All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay
@ 2011-07-19 14:14 Alexander Lyakas
  2011-07-24  7:47 ` Alexander Lyakas
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Lyakas @ 2011-07-19 14:14 UTC (permalink / raw)
  To: linux-lvm

Hello everybody,
I am using stock ubuntu natty with lvmlib 2.02.66:
root@11:/mnt/work/alex# uname -a
Linux 11 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011
x86_64 x86_64 x86_64 GNU/Linux

In my code I open a VG, iterate over all the LVs and then call
lvm_lv_deactivate() on each LV. The return value is 0, and also
immediately after that, I call lvm_lv_is_active() for each LV and
assert that it returns 0 (not-active).
Later in the code, I close the VG handle.

However, when I issue lvdisplay from command-line, I still see:
LV Status              available
and the dm device files for the LVs are also present (/dev/dm-0 etc).

As a result I cannot later stop the underlying md devices (PVs) using
'mdadm --stop'.
If I do lvchange -an from the command line later, it succeeds, LV
status becomes 'NOT available' and I am able to stop the md arrays.

From looking at the code of lvmlib, it looks like lvm_lv_deactivate()
does not require lvm_vg_write(); I see that lvchange implementation
does not seem to call this when de-activating LVs. Still, I have tried
to call lvm_vg_write() with same effect.

No other application on the machine uses the same VG (at least not
that I know of).

Can anybody please advise what I might be missing.

Thanks,
  Alex.

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

* Re: [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay
  2011-07-19 14:14 [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay Alexander Lyakas
@ 2011-07-24  7:47 ` Alexander Lyakas
  2011-07-26  2:45   ` Prathyush
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Lyakas @ 2011-07-24  7:47 UTC (permalink / raw)
  To: linux-lvm

OK, since nobody answered, let me perhaps ask a different question.

Is there any way to prevent any automatic LV activation/deactivation?
And have full manual control via lvm_lv_deactivate/lvm_lv_activate?

Setting activation = 0 in global section of lvm.conf did not do the
job, because then lvm_vg_create_lv_linear fails, so I even cannot
create a LV.

Thanks,
   Alex.


On Tue, Jul 19, 2011 at 5:14 PM, Alexander Lyakas
<alex.bolshoy@gmail.com> wrote:
>
> Hello everybody,
> I am using stock ubuntu natty with lvmlib 2.02.66:
> root@11:/mnt/work/alex# uname -a
> Linux 11 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011
> x86_64 x86_64 x86_64 GNU/Linux
>
> In my code I open a VG, iterate over all the LVs and then call
> lvm_lv_deactivate() on each LV. The return value is 0, and also
> immediately after that, I call lvm_lv_is_active() for each LV and
> assert that it returns 0 (not-active).
> Later in the code, I close the VG handle.
>
> However, when I issue lvdisplay from command-line, I still see:
> LV Status � � � � � � �available
> and the dm device files for the LVs are also present (/dev/dm-0 etc).
>
> As a result I cannot later stop the underlying md devices (PVs) using
> 'mdadm --stop'.
> If I do lvchange -an from the command line later, it succeeds, LV
> status becomes 'NOT available' and I am able to stop the md arrays.
>
> From looking at the code of lvmlib, it looks like lvm_lv_deactivate()
> does not require lvm_vg_write(); I see that lvchange implementation
> does not seem to call this when de-activating LVs. Still, I have tried
> to call lvm_vg_write() with same effect.
>
> No other application on the machine uses the same VG (at least not
> that I know of).
>
> Can anybody please advise what I might be missing.
>
> Thanks,
> �Alex.

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

* Re: [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay
  2011-07-24  7:47 ` Alexander Lyakas
@ 2011-07-26  2:45   ` Prathyush
  2011-08-06 13:22     ` Alexander Lyakas
  0 siblings, 1 reply; 4+ messages in thread
From: Prathyush @ 2011-07-26  2:45 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]

Hi,

Hope its not dismounted properly .
Do a resize2fs again and lvchange -an

Regards
Prathyush

On Sun, Jul 24, 2011 at 1:17 PM, Alexander Lyakas <alex.bolshoy@gmail.com>wrote:

> OK, since nobody answered, let me perhaps ask a different question.
>
> Is there any way to prevent any automatic LV activation/deactivation?
> And have full manual control via lvm_lv_deactivate/lvm_lv_activate?
>
> Setting activation = 0 in global section of lvm.conf did not do the
> job, because then lvm_vg_create_lv_linear fails, so I even cannot
> create a LV.
>
> Thanks,
>   Alex.
>
>
> On Tue, Jul 19, 2011 at 5:14 PM, Alexander Lyakas
> <alex.bolshoy@gmail.com> wrote:
> >
> > Hello everybody,
> > I am using stock ubuntu natty with lvmlib 2.02.66:
> > root@11:/mnt/work/alex# uname -a
> > Linux 11 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011
> > x86_64 x86_64 x86_64 GNU/Linux
> >
> > In my code I open a VG, iterate over all the LVs and then call
> > lvm_lv_deactivate() on each LV. The return value is 0, and also
> > immediately after that, I call lvm_lv_is_active() for each LV and
> > assert that it returns 0 (not-active).
> > Later in the code, I close the VG handle.
> >
> > However, when I issue lvdisplay from command-line, I still see:
> > LV Status              available
> > and the dm device files for the LVs are also present (/dev/dm-0 etc).
> >
> > As a result I cannot later stop the underlying md devices (PVs) using
> > 'mdadm --stop'.
> > If I do lvchange -an from the command line later, it succeeds, LV
> > status becomes 'NOT available' and I am able to stop the md arrays.
> >
> > From looking at the code of lvmlib, it looks like lvm_lv_deactivate()
> > does not require lvm_vg_write(); I see that lvchange implementation
> > does not seem to call this when de-activating LVs. Still, I have tried
> > to call lvm_vg_write() with same effect.
> >
> > No other application on the machine uses the same VG (at least not
> > that I know of).
> >
> > Can anybody please advise what I might be missing.
> >
> > Thanks,
> >  Alex.
>
> _______________________________________________
> 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/
>



-- 
*Regards,
Prathyush*

[-- Attachment #2: Type: text/html, Size: 3317 bytes --]

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

* Re: [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay
  2011-07-26  2:45   ` Prathyush
@ 2011-08-06 13:22     ` Alexander Lyakas
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Lyakas @ 2011-08-06 13:22 UTC (permalink / raw)
  To: LVM general discussion and development

Thank you, Prathyush.
I use lvmlib and not command-line tools. There is no FS on the LVs, so
there are no mount issues. I am issuing lvm_lv_deactivate() and it
succeeds. But later, the LV is active again....

Alex.


On Tue, Jul 26, 2011 at 5:45 AM, Prathyush <prathyush.r@gmail.com> wrote:
> Hi,
>
> Hope its not dismounted properly .
> Do a resize2fs again and lvchange -an
>
> Regards
> Prathyush
>
> On Sun, Jul 24, 2011 at 1:17 PM, Alexander Lyakas <alex.bolshoy@gmail.com>
> wrote:
>>
>> OK, since nobody answered, let me perhaps ask a different question.
>>
>> Is there any way to prevent any automatic LV activation/deactivation?
>> And have full manual control via lvm_lv_deactivate/lvm_lv_activate?
>>
>> Setting activation = 0 in global section of lvm.conf did not do the
>> job, because then lvm_vg_create_lv_linear fails, so I even cannot
>> create a LV.
>>
>> Thanks,
>> � Alex.
>>
>>
>> On Tue, Jul 19, 2011 at 5:14 PM, Alexander Lyakas
>> <alex.bolshoy@gmail.com> wrote:
>> >
>> > Hello everybody,
>> > I am using stock ubuntu natty with lvmlib 2.02.66:
>> > root@11:/mnt/work/alex# uname -a
>> > Linux 11 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011
>> > x86_64 x86_64 x86_64 GNU/Linux
>> >
>> > In my code I open a VG, iterate over all the LVs and then call
>> > lvm_lv_deactivate() on each LV. The return value is 0, and also
>> > immediately after that, I call lvm_lv_is_active() for each LV and
>> > assert that it returns 0 (not-active).
>> > Later in the code, I close the VG handle.
>> >
>> > However, when I issue lvdisplay from command-line, I still see:
>> > LV Status � � � � � � �available
>> > and the dm device files for the LVs are also present (/dev/dm-0 etc).
>> >
>> > As a result I cannot later stop the underlying md devices (PVs) using
>> > 'mdadm --stop'.
>> > If I do lvchange -an from the command line later, it succeeds, LV
>> > status becomes 'NOT available' and I am able to stop the md arrays.
>> >
>> > From looking at the code of lvmlib, it looks like lvm_lv_deactivate()
>> > does not require lvm_vg_write(); I see that lvchange implementation
>> > does not seem to call this when de-activating LVs. Still, I have tried
>> > to call lvm_vg_write() with same effect.
>> >
>> > No other application on the machine uses the same VG (at least not
>> > that I know of).
>> >
>> > Can anybody please advise what I might be missing.
>> >
>> > Thanks,
>> > �Alex.
>>
>> _______________________________________________
>> 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/
>
>
>
> --
> Regards,
> Prathyush
>
> _______________________________________________
> 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] 4+ messages in thread

end of thread, other threads:[~2011-08-06 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-19 14:14 [linux-lvm] lvm_lv_deactivate seems to have no effect, LV is still available in lvdisplay Alexander Lyakas
2011-07-24  7:47 ` Alexander Lyakas
2011-07-26  2:45   ` Prathyush
2011-08-06 13:22     ` Alexander Lyakas

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.