All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] COW store
@ 2010-07-19 11:14 andiket a
  2010-07-19 13:22 ` Stuart D Gathman
  2010-07-19 15:45 ` Greg Freemyer
  0 siblings, 2 replies; 8+ messages in thread
From: andiket a @ 2010-07-19 11:14 UTC (permalink / raw)
  To: linux-lvm

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

Hi,

Is it possible to specify a different device or to be specific a different VG than original VG to create a cow store for snapshot.

If I have a an LV in VG1 then I don't snapshot to create cow store (snapshot LV) on same VG but to use VG2.


Thanks.



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

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

* Re: [linux-lvm] COW store
  2010-07-19 11:14 [linux-lvm] COW store andiket a
@ 2010-07-19 13:22 ` Stuart D Gathman
  2010-07-19 14:58   ` ejt
  2010-07-19 15:45 ` Greg Freemyer
  1 sibling, 1 reply; 8+ messages in thread
From: Stuart D Gathman @ 2010-07-19 13:22 UTC (permalink / raw)
  To: linux-lvm

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

On 07/19/2010 07:14 AM, andiket a wrote:
> Is it possible to specify a different device or to be specific a
> different VG than original VG to create a cow store for snapshot.
>
> If I have a an LV in VG1 then I don't snapshot to create cow store
> (snapshot LV) on same VG but to use VG2.
>

Short answer: no

Long answer: support for this would defeat the purpose of volume
groups.  VGs have independent metadata so that you can remove them
independently, move between system, and so on.  If a misguided soul were
to implement your feature, then the two volume groups would have to be
"locked together" so that removing one or the other would invalidate the
snapshot.  For similar reasons, you cannot hardlink files between unix
filesystems.

If you are using volume groups for the naming only, try using a
separator in your LV names.  (LVM lawyers - what are legal chars to
use?)  For instance, I know '_' is safe, so for example instead of
vgabc/lv1 and vgdef/lv2, where you are willing to "entangle" vgabc and
vgdef because they are always online together, just make a single vgroot and
use vgroot/abc_lv1 vgroot/def_lv2.

BTW, A feature that would make more sense would be hierarchical
namespace for LVs within a VG, i.e. subdirs within the /dev/vg*
directory.  Very low priority, and tricky, but would be handy for naming
purposes.


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

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

* Re: [linux-lvm] COW store
  2010-07-19 13:22 ` Stuart D Gathman
@ 2010-07-19 14:58   ` ejt
  2010-07-19 19:03     ` andiket a
  0 siblings, 1 reply; 8+ messages in thread
From: ejt @ 2010-07-19 14:58 UTC (permalink / raw)
  To: LVM general discussion and development

At Mon, 19 Jul 2010 09:22:30 -0400,
Stuart D Gathman wrote:
> (LVM lawyers - what are legal chars to
> use?)

There don't seem to be many restrictions.  You can't have '/'s, also
the following strings are forbidden:

    ^snapshot.*
    ^pvmove.*
    .*_mlog.*
    .*_mimage.*

- Joe

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

* Re: [linux-lvm] COW store
  2010-07-19 11:14 [linux-lvm] COW store andiket a
  2010-07-19 13:22 ` Stuart D Gathman
@ 2010-07-19 15:45 ` Greg Freemyer
  2010-07-19 19:06   ` andiket a
  1 sibling, 1 reply; 8+ messages in thread
From: Greg Freemyer @ 2010-07-19 15:45 UTC (permalink / raw)
  To: LVM general discussion and development

On Mon, Jul 19, 2010 at 7:14 AM, andiket a <truly_linux@yahoo.co.in> wrote:
>
> Hi,
>
> Is it possible to specify a different device or to be specific a different VG than original VG to create a cow store for snapshot.
>
> If I have a an LV in VG1 then I don't snapshot to create cow store (snapshot LV) on same VG but to use VG2.
>
>
> Thanks.
>

Your question would make a lot more sense as:

===
Is it possible to specify a different device or to be specific a
different PV than original PV to create a cow store for snapshot?
===

Answer: Yes, when you create your main LVs and snapshot LVs you can
specify which PVs they use.

Greg

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

* Re: [linux-lvm] COW store
  2010-07-19 14:58   ` ejt
@ 2010-07-19 19:03     ` andiket a
  0 siblings, 0 replies; 8+ messages in thread
From: andiket a @ 2010-07-19 19:03 UTC (permalink / raw)
  To: LVM general discussion and development

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

Thank Stuart and Joe.

I am just composing reply to another email by Greg.
He has got my point right.



--- On Mon, 19/7/10, ejt@redhat.com <ejt@redhat.com> wrote:

From: ejt@redhat.com <ejt@redhat.com>
Subject: Re: [linux-lvm] COW store
To: "LVM general discussion and development" <linux-lvm@redhat.com>
Date: Monday, 19 July, 2010, 8:28 PM

At Mon, 19 Jul 2010 09:22:30 -0400,
Stuart D Gathman wrote:
> (LVM lawyers - what are legal chars to
> use?)

There don't seem to be many restrictions.  You can't have '/'s, also
the following strings are forbidden:

    ^snapshot.*
    ^pvmove.*
    .*_mlog.*
    .*_mimage.*

- Joe

_______________________________________________
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/



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

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

* Re: [linux-lvm] COW store
  2010-07-19 15:45 ` Greg Freemyer
@ 2010-07-19 19:06   ` andiket a
  2010-07-19 21:12     ` Greg Freemyer
  0 siblings, 1 reply; 8+ messages in thread
From: andiket a @ 2010-07-19 19:06 UTC (permalink / raw)
  To: LVM general discussion and development

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

Greg,

You got absolutely right.
That is exactly what I actually wanted to ask.

I didn't know about this pv stuff for original LVs n snapshot LVs.
Let me look at the lvcreate once again.

I want the cow store to go on to a separate physical device.



--- On Mon, 19/7/10, Greg Freemyer <greg.freemyer@gmail.com> wrote:

From: Greg Freemyer <greg.freemyer@gmail.com>
Subject: Re: [linux-lvm] COW store
To: "LVM general discussion and development" <linux-lvm@redhat.com>
Date: Monday, 19 July, 2010, 9:15 PM

On Mon, Jul 19, 2010 at 7:14 AM, andiket a <truly_linux@yahoo.co.in> wrote:
>
> Hi,
>
> Is it possible to specify a different device or to be specific a different VG than original VG to create a cow store for snapshot.
>
> If I have a an LV in VG1 then I don't snapshot to create cow store (snapshot LV) on same VG but to use VG2.
>
>
> Thanks.
>

Your question would make a lot more sense as:

===
Is it possible to specify a different device or to be specific a
different PV than original PV to create a cow store for snapshot?
===

Answer: Yes, when you create your main LVs and snapshot LVs you can
specify which PVs they use.

Greg

_______________________________________________
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/



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

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

* Re: [linux-lvm] COW store
  2010-07-19 19:06   ` andiket a
@ 2010-07-19 21:12     ` Greg Freemyer
  2010-07-20  6:29       ` andiket a
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Freemyer @ 2010-07-19 21:12 UTC (permalink / raw)
  To: LVM general discussion and development

On Mon, Jul 19, 2010 at 3:06 PM, andiket a <truly_linux@yahoo.co.in> wrote:
>
> Greg,
>
> You got absolutely right.
> That is exactly what I actually wanted to ask.
>
> I didn't know about this pv stuff for original LVs n snapshot LVs.
> Let me look at the lvcreate once again.
>
> I want the cow store to go on to a separate physical device.
>

You can create new LVs on the PVs you want by simply adding a PV param
at the end of the lvcreate line.  (See the man page).

But assuming you already have LVs created:

Use "lvdisplay -m" to show you which PVs your current LVs are on.

Assuming the LVs are not on the PVs you want them to be on, then you
can use pvmove to move the LV extents off of one PV and onto another.
I believe that can be done without disabling the LV, but I don't
recall testing it.

In my case I have 2 PVs:

PV /dev/sdb1 is for my main data and PV /dev/sda3 is for my snapshots.

If I just want to move all the LV extents off a PV so you can dedicate
it to snapshots, you can simply:

pvmove /dev/sda3               where /dev/sda3  would be the PV I'm
trying to free up.

So when setting things up I could have done "pvmove /dev/sda3" to
ensure my PV wasn't used for normal LVs.

Then one of my nightly scripts has this in it:

lvcreate --snapshot -L 45g --name data_snap /dev/TruStore-Data/data /dev/sda3

I believe that says "create a 45GB snapshot named data_snap of the
main LV on the PV /dev/sda3".  (I set that up years ago, and I admit
to not testing it recently.)

And since I setup /dev/TruStore-Data/data to be on /dev/sdb1, I know
the main LV and snapshot LV are on different PVs.

Again, at any point I can run "lvdisplay -m" to double check things
are the way I want them.

Hope that helps
Greg

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

* Re: [linux-lvm] COW store
  2010-07-19 21:12     ` Greg Freemyer
@ 2010-07-20  6:29       ` andiket a
  0 siblings, 0 replies; 8+ messages in thread
From: andiket a @ 2010-07-20  6:29 UTC (permalink / raw)
  To: LVM general discussion and development

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

Bingo.
Got exactly what I wanted. My lack of hands on with lvm utils.
Thanks a ton Greg! :-)

Let me tell you the context of why I wanted to do this.

I was experimenting with LVM. Take snapshots n take backups etc.
I figured out probabaly a room for optimization after looking at the code.
Look at the cow operation, once the data is read from original
device after that I/Os (writes) on original n cow device can proceed in
parallel. Which in current happens serially i.e. first cow write then
original device write.

I am not sure if this is on todo list of lvm. Is it already? or even if they
are thinking of any such thing.



--- On Tue, 20/7/10, Greg Freemyer <greg.freemyer@gmail.com> wrote:

From: Greg Freemyer <greg.freemyer@gmail.com>
Subject: Re: [linux-lvm] COW store
To: "LVM general discussion and development" <linux-lvm@redhat.com>
Date: Tuesday, 20 July, 2010, 2:42 AM

On Mon, Jul 19, 2010 at 3:06 PM, andiket a <truly_linux@yahoo.co.in> wrote:
>
> Greg,
>
> You got absolutely right.
> That is exactly what I actually wanted to ask.
>
> I didn't know about this pv stuff for original LVs n snapshot LVs.
> Let me look at the lvcreate once again.
>
> I want the cow store to go on to a separate physical device.
>

You can create new LVs on the PVs you want by simply adding a PV param
at the end of the lvcreate line.  (See the man page).

But assuming you already have LVs created:

Use "lvdisplay -m" to show you which PVs your current LVs are on.

Assuming the LVs are not on the PVs you want them to be on, then you
can use pvmove to move the LV extents off of one PV and onto another.
I believe that can be done without disabling the LV, but I don't
recall testing it.

In my case I have 2 PVs:

PV /dev/sdb1 is for my main data and PV /dev/sda3 is for my snapshots.

If I just want to move all the LV extents off a PV so you can dedicate
it to snapshots, you can simply:

pvmove /dev/sda3               where /dev/sda3  would be the PV I'm
trying to free up.

So when setting things up I could have done "pvmove /dev/sda3" to
ensure my PV wasn't used for normal LVs.

Then one of my nightly scripts has this in it:

lvcreate --snapshot -L 45g --name data_snap /dev/TruStore-Data/data /dev/sda3

I believe that says "create a 45GB snapshot named data_snap of the
main LV on the PV /dev/sda3".  (I set that up years ago, and I admit
to not testing it recently.)

And since I setup /dev/TruStore-Data/data to be on /dev/sdb1, I know
the main LV and snapshot LV are on different PVs.

Again, at any point I can run "lvdisplay -m" to double check things
are the way I want them.

Hope that helps
Greg

_______________________________________________
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/



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

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

end of thread, other threads:[~2010-07-20  6:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 11:14 [linux-lvm] COW store andiket a
2010-07-19 13:22 ` Stuart D Gathman
2010-07-19 14:58   ` ejt
2010-07-19 19:03     ` andiket a
2010-07-19 15:45 ` Greg Freemyer
2010-07-19 19:06   ` andiket a
2010-07-19 21:12     ` Greg Freemyer
2010-07-20  6:29       ` andiket a

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.