<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Bingo.<br>Got exactly what I wanted. My lack of hands on with lvm utils.<br>Thanks a ton Greg! :-)<br><br>Let me tell you the context of why I wanted to do this.<br><br>I was experimenting with LVM. Take snapshots n take backups etc.<br>I figured out probabaly a room for optimization after looking at the code.<br>Look at the cow operation, once the data is read from original<br>device after that I/Os (writes) on original n cow device can proceed in<br>parallel. Which in current happens serially i.e. first cow write then<br>original device write.<br><br>I am not sure if this is on todo list of lvm. Is it already? or even if they<br>are thinking of any such thing.<br><br><br><br>--- On <b>Tue, 20/7/10, Greg Freemyer <i><greg.freemyer@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left:
 5px;"><br>From: Greg Freemyer <greg.freemyer@gmail.com><br>Subject: Re: [linux-lvm] COW store<br>To: "LVM general discussion and development" <linux-lvm@redhat.com><br>Date: Tuesday, 20 July, 2010, 2:42 AM<br><br><div class="plainMail">On Mon, Jul 19, 2010 at 3:06 PM, andiket a <<a ymailto="mailto:truly_linux@yahoo.co.in" href="/mc/compose?to=truly_linux@yahoo.co.in">truly_linux@yahoo.co.in</a>> wrote:<br>><br>> Greg,<br>><br>> You got absolutely right.<br>> That is exactly what I actually wanted to ask.<br>><br>> I didn't know about this pv stuff for original LVs n snapshot LVs.<br>> Let me look at the lvcreate once again.<br>><br>> I want the cow store to go on to a separate physical device.<br>><br><br>You can create new LVs on the PVs you want by simply adding a PV param<br>at the end of the lvcreate line.  (See the man page).<br><br>But assuming you already have LVs created:<br><br>Use
 "lvdisplay -m" to show you which PVs your current LVs are on.<br><br>Assuming the LVs are not on the PVs you want them to be on, then you<br>can use pvmove to move the LV extents off of one PV and onto another.<br>I believe that can be done without disabling the LV, but I don't<br>recall testing it.<br><br>In my case I have 2 PVs:<br><br>PV /dev/sdb1 is for my main data and PV /dev/sda3 is for my snapshots.<br><br>If I just want to move all the LV extents off a PV so you can dedicate<br>it to snapshots, you can simply:<br><br>pvmove /dev/sda3               where /dev/sda3  would be the PV I'm<br>trying to free up.<br><br>So when setting things up I could have done "pvmove /dev/sda3" to<br>ensure my PV wasn't used for normal LVs.<br><br>Then one of my nightly scripts has this in it:<br><br>lvcreate --snapshot -L 45g --name data_snap /dev/TruStore-Data/data /dev/sda3<br><br>I believe that says "create a
 45GB snapshot named data_snap of the<br>main LV on the PV /dev/sda3".  (I set that up years ago, and I admit<br>to not testing it recently.)<br><br>And since I setup /dev/TruStore-Data/data to be on /dev/sdb1, I know<br>the main LV and snapshot LV are on different PVs.<br><br>Again, at any point I can run "lvdisplay -m" to double check things<br>are the way I want them.<br><br>Hope that helps<br>Greg<br><br>_______________________________________________<br>linux-lvm mailing list<br><a ymailto="mailto:linux-lvm@redhat.com" href="/mc/compose?to=linux-lvm@redhat.com">linux-lvm@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/linux-lvm" target="_blank">https://www.redhat.com/mailman/listinfo/linux-lvm</a><br>read the LVM HOW-TO at <a href="http://tldp.org/HOWTO/LVM-HOWTO/" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br></div></blockquote></td></tr></table><br>