[linux-lvm] LVM and chain of snapshots
socketpair at gmail.com
Wed Jan 20 10:37:12 UTC 2016
I am aware that this subject was raised in mailing lists, but I haven't
found an obvious solution there.
Why not to add an option to lvcreate when creating snapshots, to switch
origin and snapshot ?
I mean that while (in this mode) creating snapshot named xxx of volume name
yyy, the following should be done:
1. xxx-real dmsetup volume is created with identical table as in yyy
2. yyy-cow dmsetup volume is created to store snapshot data
3. yyy is switched to table "snapshot xxx-real yyy-cow"
4. xxx created as "snapshot-origin xxx-real"
So, if FS was mounted from yyy, after creating such snapshot, all writes on
that FS should go to yyy-cow actually.
Note, performance of the writes to yyy will not be affected (comparing to
creating generic snapshot as usual).
At this stage, picture is the following:
[original=linear=xxx] -> [snapshot=yyy referring xxx (mounted FS)]
Next, user may decide to create new snapshot named zzz of volume yyy in
this new mode. After that picture will look like:
[original=linear=xxx] -> [snapshot=zzz referring xxx] -> [snapshot=yyy
referring zzz (mounted FS)]
Note, that having plenty snapshots in that mode will not affect write
performance of yyy. Yes, performance of read operations may slightly suffer
since require to lookup chain of snapshots, but this is much less
performance impact comparing to writes to original when plenty snapshots
created (in generic mode).
Next, this structure allows merging (i.e. zzz into xxx for example)
snapshots in chain easily.
P.S. we may call this operation "split origin" instead of "create snapshot"
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the linux-lvm