mpalmer / lvmsync

Synchronise LVM LVs across a network by sending only snapshotted changes
http://theshed.hezmatt.org/lvmsync
GNU General Public License v3.0
382 stars 61 forks source link

Create snapback files without full backup #2

Closed ProTip closed 9 years ago

ProTip commented 12 years ago

Changing this:

    if snapback
        snapback.write(header)
        snapback.write dest.read(chunksize)
        dest.seek offset * chunksize
    end
    dest.write instream.read(chunksize)
end

To this

    if snapback
        snapback.write(header)
        snapback.write dest.read(chunksize)
        dest.seek offset * chunksize
        instream.read(chunksize)
    else
        dest.write instream.read(chunksize)
    end
end

Will allow you to creat a snapback file(s) by having the target and destination device a snapshot, without ruining the snapshot.

ProTip commented 12 years ago

I believe this would allow you to create snap-forward files as well. Just source the snapshot, and make the origin the destination. Sim to default behavior, but it would save it to a file.

mpalmer commented 12 years ago

I'm afraid I don't understand what you're getting at here. Can you elaborate a little more, perhaps with an example? I feel like I've gotten something really wrong, but I can't quite put my finger on it.

ProTip commented 12 years ago

Er, forget the snap-forward bit, that would require copying out all of the cow volumes data. But the change I made essentially allows me to use the tool to merge a snapshot back into the source through your snap-back file mechanism. It's useful to me because some of our infrastructure is on debian lenny and without the ability to use lvm2's merging functionality.

mpalmer commented 9 years ago

I'm going to close this, on the basis that I'm still not sure what's being asked for, and it was last mentioned two years ago.