]> sourceware.org Git - lvm2.git/commit
Add the ability to split an image from the mirror and track changes.
authorJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 18 Aug 2011 19:38:26 +0000 (19:38 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 18 Aug 2011 19:38:26 +0000 (19:38 +0000)
commit6d04311efabec604e92664da1979176c1167e826
treee775ca86c6b079309e82611c08b26377c12ed425
parenta324baf6a13cb84f46dda81b6f3c7e795820c35d
Add the ability to split an image from the mirror and track changes.

~> lvconvert --splitmirrors 1 --trackchanges vg/lv
The '--trackchanges' option allows a user the ability to use an image of
a RAID1 array for the purposes of temporary read-only access.  The image
can be merged back into the array at a later time and only the blocks that
have changed in the array since the split will be resync'ed.  This
operation can be thought of as a partial split.  The image is never completely
extracted from the array, in that the array reserves the position the device
occupied and tracks the differences between the array and the split image via
a bitmap.  The image itself is rendered read-only and the name (<LV>_rimage_*)
cannot be changed.  The user can complete the split (permanently splitting the
image from the array) by re-issuing the 'lvconvert' command without the
'--trackchanges' argument and specifying the '--name' argument.
~> lvconvert --splitmirrors 1 --name my_split vg/lv
Merging the tracked image back into the array is done with the '--merge'
option (included in a follow-on patch).
~> lvconvert --merge vg/lv_rimage_<n>

The internal mechanics of this are relatively simple.  The 'raid' device-
mapper target allows for the specification of an empty slot in an array
via '- -'.  This is what will be used if a partial activation of an array
is ever required.  (It would also be possible to use 'error' targets in
place of the '- -'.)  If a RAID image is found to be both read-only and
visible, then it is considered separate from the array and '- -' is used
to hold it's position in the array.  So, all that needs to be done to
temporarily split an image from the array /and/ cause the kernel target's
bitmap to track (aka "mark") changes made is to make the specified image
visible and read-only.  To merge the device back into the array, the image
needs to be returned to the read/write state of the top-level LV and made
invisible.
WHATS_NEW
lib/activate/dev_manager.c
lib/metadata/metadata-exported.h
lib/metadata/raid_manip.c
libdm/libdevmapper.h
libdm/libdm-deptree.c
man/lvconvert.8.in
tools/args.h
tools/commands.h
tools/lvconvert.c
This page took 0.032086 seconds and 5 git commands to generate.