Closed pepa65 closed 9 years ago
I removed both logical volumes, then created os again as a snapshot of my root partition, osbackup as a fresh logical volume, and got the same result as last time... The snapshot (os) is mountable, the lvsync-ed volume (osbackup) isn't... I'll try again with different names..?
Apparently I'm not understanding the capabilities of lvmsync... I tried again with different names. I am looking for a rsync-on-blockdevices tool, and since my blockdevices are lvm logical volumes, lvmsync sounded suitable from my understanding of reading the description...
Without knowing exactly how you created the snapshot, I can't determine what's going wrong. Could you please provide the complete set of commands you ran, from the point at which you created the snapshot?
As far as lvmsync
being an "rsync-for-blockdevices" tool, it's not a complete equivalent to rsync. lvmsync
only copies changes; it doesn't do the initial sync -- that's what the dd
command, run between the snapshot creation and the lvmsync
run, is for.
(What went wrong is, I didn't do the dd.) OK, so I want to periodically make device2 the same as device1. I make a snapshot of device1, dd that over to device2. Device1 will change further, but whenever I want to syncronize them, I use lvmsync to make device2 the same as device1. As long as the snapshot of device1 exists, this works.
Is this how it works?
That is one way to make it work. However, the snapshot will gradually get larger and larger, and the lvmsync runs will get longer and longer as a consequence.
The more efficient way of doing what you want is to make a second snapshot before you do the first lvmsync (against the first snapshot), then delete the first snapshot. You can continue to periodically do this "take new snapshot, lvmsync old snapshot, delete old snapshot" process, to update your mirror LV. It's not pretty, but it works.
Thanks for your help and explanations. I should have been able to gather all this from the documentation. Knowing about making a snapshot of the snapshot regularly is very helpful. Will try again.
On my very first run of lvmsync I did: lvmsync /dev/secret/os /dev/secret/osbackup I decided I wanted a verbose switch, so I interrupted, with this output: ^C/var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:292:in'
write': Interrupt from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:292:in
print' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:292:inblock (2 levels) in dump_changes' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:282:in
each' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:282:inblock in dump_changes' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:281:in
open' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:281:indump_changes' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:231:in
block in run_client' from /usr/lib/ruby/1.9.1/open3.rb:208:inpopen_run' from /usr/lib/ruby/1.9.1/open3.rb:90:in
popen3' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:228:inrun_client' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:124:in
main' from /var/lib/gems/1.9.1/gems/lvmsync-3.3.0/bin/lvmsync:357:in<top (required)>' from /usr/local/bin/lvmsync:23:in
load' from /usr/local/bin/lvmsync:23:in `So then I did: lvmsync -v /dev/secret/os /dev/secret/osbackup Which led to this output: Data source: /dev/mapper/secret-ubuntu remote:Writing changed data to "/dev/secret/osbackup" Transferred 1290240 bytes in 2.58 seconds You transferred your changes 30112.10x faster than a full dd!
Which can't be true for a 36GB partition. The resulting /dev/secret/osbackup isn't mountable. So I'm wondering how to proceed, how can I 'reset' the somehow wrong information lvmsync is working with?