* [linux-lvm] copy lv from lv? @ 2011-03-29 12:53 yue 2011-03-29 17:48 ` Ray Morris 2011-03-30 13:49 ` yue 0 siblings, 2 replies; 10+ messages in thread From: yue @ 2011-03-29 12:53 UTC (permalink / raw) To: linux-lvm [-- Attachment #1: Type: text/plain, Size: 87 bytes --] if lvm do not support lv copy? it is better copy on write. dd takes long time. thanks [-- Attachment #2: Type: text/html, Size: 217 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-29 12:53 [linux-lvm] copy lv from lv? yue @ 2011-03-29 17:48 ` Ray Morris 2011-03-30 13:49 ` yue 1 sibling, 0 replies; 10+ messages in thread From: Ray Morris @ 2011-03-29 17:48 UTC (permalink / raw) To: linux-lvm > if lvm do not support lv copy? it is better copy on write. > dd takes long time. For a complete copy the only thing faster than "dd" is two copies of "dd" piped together. dd is basically limited by the speed of the physical disks, assuming proper arguments to dd. For a copy on write, that's called a snapshot. LVM COULD beused to copy, by making and splitting a mirror, but that's going to be a lot slower than dd. (Though a mirror and split can be used on a live filesystem, wth it unmounted only for an instant during the split). -- Ray Morris support@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On Tue, 29 Mar 2011 20:53:37 +0800 (CST) yue <ooolinux@163.com> wrote: > if lvm do not support lv copy? it is better copy on write. > dd takes long time. > > thanks ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-29 12:53 [linux-lvm] copy lv from lv? yue 2011-03-29 17:48 ` Ray Morris @ 2011-03-30 13:49 ` yue 2011-03-30 18:28 ` Ray Morris 1 sibling, 1 reply; 10+ messages in thread From: yue @ 2011-03-30 13:49 UTC (permalink / raw) To: LVM general discussion and development [-- Attachment #1: Type: text/plain, Size: 1660 bytes --] 1..how to pipe two copy together 2.i take lv as xen-guestOS's disk. usually many guestOS created from one lv(called template), maybe many data is readonly, so if so many lvs share readonly part ,and have its private data? COW save disk space, and take less time. i do not think snapshot is sutable for this case. thanks At 2011-03-30 01:48:14,"Ray Morris" <support@bettercgi.com> wrote: >> if lvm do not support lv copy? it is better copy on write. >> dd takes long time. > >For a complete copy the only thing faster than "dd" is two >copies of "dd" piped together. dd is basically limited by >the speed of the physical disks, assuming proper arguments >to dd. For a copy on write, that's called a snapshot. LVM >COULD beused to copy, by making and splitting a mirror, but >that's going to be a lot slower than dd. (Though a mirror and >split can be used on a live filesystem, wth it unmounted only >for an instant during the split). >-- >Ray Morris >support@bettercgi.com > >Strongbox - The next generation in site security: >http://www.bettercgi.com/strongbox/ > >Throttlebox - Intelligent Bandwidth Control >http://www.bettercgi.com/throttlebox/ > >Strongbox / Throttlebox affiliate program: >http://www.bettercgi.com/affiliates/user/register.php > > > > >On Tue, 29 Mar 2011 20:53:37 +0800 (CST) >yue <ooolinux@163.com> wrote: > >> if lvm do not support lv copy? it is better copy on write. >> dd takes long time. >> >> thanks > >_______________________________________________ >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: 2817 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-30 13:49 ` yue @ 2011-03-30 18:28 ` Ray Morris 2011-03-31 0:27 ` Stuart D. Gathman 2011-04-01 2:46 ` [linux-lvm] " yue 0 siblings, 2 replies; 10+ messages in thread From: Ray Morris @ 2011-03-30 18:28 UTC (permalink / raw) To: LVM general discussion and development; +Cc: ooolinux > 1..how to pipe two copy together This is what I use after some experimenting. I've found it's often far faster than the more obvious use of dd: nice -5 dd if=/dev/clones/from bs=64M iflag=direct | dd of=/dev/scratch/to bs=64M oflag=direct I use 64 MB extents. For smaller extents, a matching dd block size might be good. > 2.i take lv as xen-guestOS's disk. usually many guestOS created > from one lv(called template), maybe many data is readonly, so if so > many lvs share readonly part ,and have its private data? COW save > disk space, and take less time. i do not think snapshot is sutable > for this case. thanks Some people use snapshots for that purpose. I'm not one of those people, so I don't know details, other than that it can be done. If you are creating that template guest, meaning that you can choose the filesystem layout, etc., the most efficient but less flexible option may be to decide explicitly what's read only. The liveCD crowd has documented procedures gained from their experience in making most of the system read only. As a side benefit, such systems can't be rooted or screwed up in some ways, so there's a level of trust knowing the core system is "correct". Then you could mount the same image for the readonyl portions of many guests, while mounting "per guest" images for /home, /tmp, etc. -- Ray Morris support@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On Wed, 30 Mar 2011 21:49:21 +0800 (CST) yue <ooolinux@163.com> wrote: > 1..how to pipe two copy together > 2.i take lv as xen-guestOS's disk. usually many guestOS created > from one lv(called template), maybe many data is readonly, so if so > many lvs share readonly part ,and have its private data? COW save > disk space, and take less time. i do not think snapshot is sutable > for this case. thanks > > > > > At 2011-03-30 01:48:14,"Ray Morris" <support@bettercgi.com> wrote: > > >> if lvm do not support lv copy? it is better copy on write. > >> dd takes long time. > > > >For a complete copy the only thing faster than "dd" is two > >copies of "dd" piped together. dd is basically limited by > >the speed of the physical disks, assuming proper arguments > >to dd. For a copy on write, that's called a snapshot. LVM > >COULD beused to copy, by making and splitting a mirror, but > >that's going to be a lot slower than dd. (Though a mirror and > >split can be used on a live filesystem, wth it unmounted only > >for an instant during the split). > >-- > >Ray Morris > >support@bettercgi.com > > > >Strongbox - The next generation in site security: > >http://www.bettercgi.com/strongbox/ > > > >Throttlebox - Intelligent Bandwidth Control > >http://www.bettercgi.com/throttlebox/ > > > >Strongbox / Throttlebox affiliate program: > >http://www.bettercgi.com/affiliates/user/register.php > > > > > > > > > >On Tue, 29 Mar 2011 20:53:37 +0800 (CST) > >yue <ooolinux@163.com> wrote: > > > >> if lvm do not support lv copy? it is better copy on write. > >> dd takes long time. > >> > >> thanks > > > >_______________________________________________ > >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] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-30 18:28 ` Ray Morris @ 2011-03-31 0:27 ` Stuart D. Gathman 2011-03-31 12:15 ` Zdenek Kabelac 2011-04-01 2:46 ` [linux-lvm] " yue 1 sibling, 1 reply; 10+ messages in thread From: Stuart D. Gathman @ 2011-03-31 0:27 UTC (permalink / raw) To: LVM general discussion and development; +Cc: ooolinux On Wed, 30 Mar 2011, Ray Morris wrote: >> 1..how to pipe two copy together > > This is what I use after some experimenting. I've found > it's often far faster than the more obvious use of dd: > > nice -5 dd if=/dev/clones/from bs=64M iflag=direct | > dd of=/dev/scratch/to bs=64M oflag=direct > > I use 64 MB extents. For smaller extents, a matching dd > block size might be good. Thanks for that recipe. It ought to be in lvm2 as an lvcopy utility (dynamically determining extent size, etc). >> 2.i take lv as xen-guestOS's disk. usually many guestOS created >> from one lv(called template), maybe many data is readonly, so if so >> many lvs share readonly part ,and have its private data? COW save >> disk space, and take less time. i do not think snapshot is sutable >> for this case. thanks As long as the origin is not often modified, having many snapshots is efficient. Each write to the origin will of course entail a write to each snapshot. (And as I discovered recently, if write barriers are disabled or buggy at any hardware or software layer, a power failure during heavy writes to the origin is particularly vulnerable to write reordering corrupting a snapshot. So make sure UPS is working before updating the origin.) -- 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] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-31 0:27 ` Stuart D. Gathman @ 2011-03-31 12:15 ` Zdenek Kabelac 2011-04-05 16:25 ` Ray Morris 0 siblings, 1 reply; 10+ messages in thread From: Zdenek Kabelac @ 2011-03-31 12:15 UTC (permalink / raw) To: linux-lvm Dne 31.3.2011 02:27, Stuart D. Gathman napsal(a): > On Wed, 30 Mar 2011, Ray Morris wrote: > >>> 1..how to pipe two copy together >> >> This is what I use after some experimenting. I've found >> it's often far faster than the more obvious use of dd: >> >> nice -5 dd if=/dev/clones/from bs=64M iflag=direct | >> dd of=/dev/scratch/to bs=64M oflag=direct >> >> I use 64 MB extents. For smaller extents, a matching dd >> block size might be good. > > Thanks for that recipe. It ought to be in lvm2 as an lvcopy utility > (dynamically determining extent size, etc). > Isn't this already done in a better way by 'dd' using 'zero' copy mechanism ?? (assuming it is already using either 'mmap()' -> 'write()' or 'splice()' as your proposed piped copy is doing a lot of pointless memory copies and cache trashing. If it's still faster - then your kernel setting for buffering are most probaly not tuned for the best performance. Zdenek ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-31 12:15 ` Zdenek Kabelac @ 2011-04-05 16:25 ` Ray Morris 2011-04-05 21:10 ` Zdenek Kabelac 0 siblings, 1 reply; 10+ messages in thread From: Ray Morris @ 2011-04-05 16:25 UTC (permalink / raw) To: LVM general discussion and development; +Cc: zkabelac > Isn't this already done in a better way by 'dd' using 'zero' copy > mechanism ?? (assuming it is already using either 'mmap()' -> > 'write()' or 'splice()' as your proposed piped copy is doing a lot > of pointless memory copies and cache trashing. No, with directio there isn't "a lot of pointless memory copies and cache trashing". There are in fact fewer mempoy copies than there would be with a simple: dd if=thing of=thing See: http://www.ukuug.org/events/linux2001/papers/html/AArcangeli-o_direct.html The proof of the pudding is in the eating, and in fact that recipe is extremely fast, for this application (sequential copy of GBs from one device to another). I spent a couple of hours testing before spending hundreds of hours copying. My bottom line was speed, so I didn't even look at memory usage or CPU. I would't mind using an extra 64 MB in order to get my copying done 30 hours faster. -- Ray Morris support@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On Thu, 31 Mar 2011 14:15:04 +0200 Zdenek Kabelac <zkabelac@redhat.com> wrote: > Dne 31.3.2011 02:27, Stuart D. Gathman napsal(a): > > On Wed, 30 Mar 2011, Ray Morris wrote: > > > >>> 1..how to pipe two copy together > >> > >> This is what I use after some experimenting. I've found > >> it's often far faster than the more obvious use of dd: > >> > >> nice -5 dd if=/dev/clones/from bs=64M iflag=direct | > >> dd of=/dev/scratch/to bs=64M oflag=direct > >> > >> I use 64 MB extents. For smaller extents, a matching dd > >> block size might be good. > > > > Thanks for that recipe. It ought to be in lvm2 as an lvcopy utility > > (dynamically determining extent size, etc). > > > > > Isn't this already done in a better way by 'dd' using 'zero' copy > mechanism ?? (assuming it is already using either 'mmap()' -> > 'write()' or 'splice()' as your proposed piped copy is doing a lot > of pointless memory copies and cache trashing. > > If it's still faster - then your kernel setting for buffering are > most probaly not tuned for the best performance. > > 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] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-04-05 16:25 ` Ray Morris @ 2011-04-05 21:10 ` Zdenek Kabelac 2011-04-05 21:29 ` [linux-lvm] Taking it off list - " Ray Morris 0 siblings, 1 reply; 10+ messages in thread From: Zdenek Kabelac @ 2011-04-05 21:10 UTC (permalink / raw) To: Ray Morris; +Cc: LVM general discussion and development Dne 5.4.2011 18:25, Ray Morris napsal(a): >> Isn't this already done in a better way by 'dd' using 'zero' copy >> mechanism ?? (assuming it is already using either 'mmap()' -> >> 'write()' or 'splice()' as your proposed piped copy is doing a lot >> of pointless memory copies and cache trashing. > > No, with directio there isn't "a lot of pointless memory copies > and cache trashing". There are in fact fewer mempoy copies than > there would be with a simple: > dd if=thing of=thing > > See: > http://www.ukuug.org/events/linux2001/papers/html/AArcangeli-o_direct.html > Seem like 10 years old paper for 2.4.6 kernel - so I do not think it still applies to upstream 2.6.38 - thought I've not made any recent measuring myself. > The proof of the pudding is in the eating, and in fact that > recipe is extremely fast, for this application (sequential > copy of GBs from one device to another). I spent a couple > of hours testing before spending hundreds of hours copying. > My bottom line was speed, so I didn't even look at memory > usage or CPU. I would't mind using an extra 64 MB in order > to get my copying done 30 hours faster. The kernel should be able to use as much free memory as you have - and when it's properly configured - disk flushing running in separate thread should ensure maximal throughput. If you are experiencing significant performance degradation with usage of single 'dd' with two different driver compared with 2 piped 'dd' - you should probably make a report on lkml list - There is something broken if you gain 'hours' like you said by piping 2 dd commands. (I don't have fast enough arrays myself for such playing) Zdenek ^ permalink raw reply [flat|nested] 10+ messages in thread
* [linux-lvm] Taking it off list - Re: copy lv from lv? 2011-04-05 21:10 ` Zdenek Kabelac @ 2011-04-05 21:29 ` Ray Morris 0 siblings, 0 replies; 10+ messages in thread From: Ray Morris @ 2011-04-05 21:29 UTC (permalink / raw) To: linux-lvm > If you are experiencing significant performance degradation with > usage of single 'dd' with two different driver compared with 2 > piped 'dd' - you should probably make a report on lkml list - There > is something broken if you gain 'hours' like you said by piping 2 dd > commands. I'm taking this off list as off topic, so if anyone else is interested please let me know and I'll update you on what we find. -- Ray Morris support@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On Tue, 05 Apr 2011 23:10:20 +0200 Zdenek Kabelac <zkabelac@redhat.com> wrote: > Dne 5.4.2011 18:25, Ray Morris napsal(a): > >> Isn't this already done in a better way by 'dd' using 'zero' copy > >> mechanism ?? (assuming it is already using either 'mmap()' -> > >> 'write()' or 'splice()' as your proposed piped copy is doing a lot > >> of pointless memory copies and cache trashing. > > > > No, with directio there isn't "a lot of pointless memory copies > > and cache trashing". There are in fact fewer mempoy copies than > > there would be with a simple: > > dd if=thing of=thing > > > > See: > > http://www.ukuug.org/events/linux2001/papers/html/AArcangeli-o_direct.html > > > > Seem like 10 years old paper for 2.4.6 kernel - so I do not think it > still applies to upstream 2.6.38 - thought I've not made any recent > measuring myself. > > > The proof of the pudding is in the eating, and in fact that > > recipe is extremely fast, for this application (sequential > > copy of GBs from one device to another). I spent a couple > > of hours testing before spending hundreds of hours copying. > > My bottom line was speed, so I didn't even look at memory > > usage or CPU. I would't mind using an extra 64 MB in order > > to get my copying done 30 hours faster. > > The kernel should be able to use as much free memory as you have - and > when it's properly configured - disk flushing running in separate > thread should ensure maximal throughput. > > If you are experiencing significant performance degradation with > usage of single 'dd' with two different driver compared with 2 > piped 'dd' - you should probably make a report on lkml list - There > is something broken if you gain 'hours' like you said by piping 2 dd > commands. > > (I don't have fast enough arrays myself for such playing) > > 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] 10+ messages in thread
* Re: [linux-lvm] copy lv from lv? 2011-03-30 18:28 ` Ray Morris 2011-03-31 0:27 ` Stuart D. Gathman @ 2011-04-01 2:46 ` yue 1 sibling, 0 replies; 10+ messages in thread From: yue @ 2011-04-01 2:46 UTC (permalink / raw) To: LVM general discussion and development [-- Attachment #1: Type: text/plain, Size: 2310 bytes --] 1.what i mean is that, when copy one lv, i would like use it's snapshot, not origin, because origin is always template. making a snapshot is very quick. but if can take a thousand snapshots from one lv, same size as origin? while the snapshots are readable and writable? thanks 2.nice -5 dd if=/dev/clones/from bs=64M iflag=direct | dd of=/dev/scratch/to bs=64M oflag=direct the pipe base on STDIN,STDOUT. i do not think STDIN,STDOUT have too mush cache At 2011-03-31 08:27:52,"Stuart D. Gathman" <stuart@bmsi.com> wrote: >On Wed, 30 Mar 2011, Ray Morris wrote: > >>> 1..how to pipe two copy together >> >> This is what I use after some experimenting. I've found >> it's often far faster than the more obvious use of dd: >> >> nice -5 dd if=/dev/clones/from bs=64M iflag=direct | >> dd of=/dev/scratch/to bs=64M oflag=direct >> >> I use 64 MB extents. For smaller extents, a matching dd >> block size might be good. > >Thanks for that recipe. It ought to be in lvm2 as an lvcopy utility >(dynamically determining extent size, etc). > >>> 2.i take lv as xen-guestOS's disk. usually many guestOS created >>> from one lv(called template), maybe many data is readonly, so if so >>> many lvs share readonly part ,and have its private data? COW save >>> disk space, and take less time. i do not think snapshot is sutable >>> for this case. thanks > >As long as the origin is not often modified, having many snapshots >is efficient. Each write to the origin will of course entail a write >to each snapshot. (And as I discovered recently, if write barriers are >disabled or buggy at any hardware or software layer, a power failure during >heavy writes to the origin is particularly vulnerable to write reordering >corrupting a snapshot. So make sure UPS is working before updating the >origin.) > >-- > 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. > >_______________________________________________ >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: 4128 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-04-05 21:29 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-03-29 12:53 [linux-lvm] copy lv from lv? yue 2011-03-29 17:48 ` Ray Morris 2011-03-30 13:49 ` yue 2011-03-30 18:28 ` Ray Morris 2011-03-31 0:27 ` Stuart D. Gathman 2011-03-31 12:15 ` Zdenek Kabelac 2011-04-05 16:25 ` Ray Morris 2011-04-05 21:10 ` Zdenek Kabelac 2011-04-05 21:29 ` [linux-lvm] Taking it off list - " Ray Morris 2011-04-01 2:46 ` [linux-lvm] " yue
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).