Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] lvm snapshot cloning



> On Oct 23, 2011, at 7:08 PM, markw at mohawksoft.com wrote:
>>
>> So, correct me if I'm wrong, is there a utility to create a an active
>> 1:1
>> copy of a snapshot in LVM2?
>
> dd
>
> Really.  LVM volumes are block devices, and the simplest way to make a 1:1
> copy of a block device is with dd.

That may be the "easiest way" but it certainly not the most efficient way.

Suppose you have a 1TB logical volume. You create a point in time snapshot
for testing or backup. At a later point you want to create a copy of that
snapshot to do some work on the data. A snapshot does not contain the
data, it only contains the old data from a "copy on write" change in the
real device.

Since the snapshot was created, the disk has changed very little. Your way
would take up a whole additional 1TB of space. OMG. If you can read/write
30MB/s it would take you 14 hours to copy.

The real solution, and I have code to do it, is this:

create a snapshot of device A, call it foo.
(arbitrary length of time passes)
create a second snapshot of A, call it bar.

Both these snapshots are now "tracking" the real volume. Now, you use the
COW data from the first snapshot and apply it to the second snapshot. This
will create two identical snapshots. Both sparsely populated with only the
differences between themselves and the real volume. The only drawback is
that the two snapshots will contain duplicate COW data.


>
> --Rich P.
>
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://lists.blu.org/mailman/listinfo/discuss
>





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org