Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.14]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6K6TjoE026535 for ; Tue, 20 Jul 2010 02:29:45 -0400 Received: from web137318.mail.in.yahoo.com (web137318.mail.in.yahoo.com [121.101.151.145]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id o6K6TZNF032131 for ; Tue, 20 Jul 2010 02:29:36 -0400 Message-ID: <670541.99249.qm@web137318.mail.in.yahoo.com> Date: Tue, 20 Jul 2010 11:59:34 +0530 (IST) From: andiket a In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-805020753-1279607374=:99249" Subject: Re: [linux-lvm] COW store Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: LVM general discussion and development --0-805020753-1279607374=:99249 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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 the= y are thinking of any such thing. --- On Tue, 20/7/10, Greg Freemyer wrote: From: Greg Freemyer Subject: Re: [linux-lvm] COW store To: "LVM general discussion and development" Date: Tuesday, 20 July, 2010, 2:42 AM On Mon, Jul 19, 2010 at 3:06 PM, andiket a 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.=A0 (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=A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0where /dev/sda3=A0 would b= e 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/sd= a3 I believe that says "create a 45GB snapshot named data_snap of the main LV on the PV /dev/sda3".=A0 (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/ =0A=0A --0-805020753-1279607374=:99249 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Bingo.
Got exactly what I wanted. My lack = of hands on with lvm utils.
Thanks a ton Greg! :-)

Let me tell yo= u the context of why I wanted to do this.

I was experimenting with L= VM. Take snapshots n take backups etc.
I figured out probabaly a room fo= r optimization after looking at the code.
Look at the cow operation, onc= e the data is read from original
device after that I/Os (writes) on orig= inal n cow device can proceed in
parallel. Which in current happens seri= ally i.e. first cow write then
original device write.

I am not su= re if this is on todo list of lvm. Is it already? or even if they
are th= inking of any such thing.



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

From: Greg Freemyer <greg.freemyer@gmail.com>
Subject: = Re: [linux-lvm] COW store
To: "LVM general discussion and development" &= lt;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:
>
> G= reg,
>
> You got absolutely right.
> That is exactly what= I actually wanted to ask.
>
> I didn't know about this pv stuf= f 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 physica= l device.
>

You can create new LVs on the PVs you want by simp= ly 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.

Assum= ing 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 a= nd 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             &nb= sp; 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
e= nsure my PV wasn't used for normal LVs.

Then one of my nightly scrip= ts 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 knowthe main LV and snapshot LV are on different PVs.

Again, at any poi= nt I can run "lvdisplay -m" to double check things
are the way I want th= em.

Hope that helps
Greg

_________________________________= ______________
linux-lvm mailing list
linux-lvm@redhat= .com
https://www.redhat.com/mailman/listinfo/linux-lvm
r= ead the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

--0-805020753-1279607374=:99249--