<div dir="ltr">I am aware that this subject was raised in mailing lists, but I haven't found an obvious solution there.<div><br></div><div>Why not to add an option to lvcreate when creating snapshots, to switch origin and snapshot ?</div><div><br></div><div>I mean that while (in this mode) creating snapshot named xxx of volume name yyy, the following should be done:</div><div><br></div><div>1. xxx-real dmsetup volume is created with identical table as in yyy</div><div>2. yyy-cow dmsetup volume is created to store snapshot data</div><div>3. yyy is switched to table "snapshot xxx-real yyy-cow"<br></div><div>4. xxx created as "snapshot-origin xxx-real"</div><div><br></div><div>So, if FS was mounted from yyy, after creating such snapshot, all writes on that FS should go to yyy-cow actually.<br><br><div><div>Note, performance of the writes to yyy will not be affected (comparing to creating generic snapshot as usual).</div><div><br></div><div>At this stage, picture is the following:</div><div><br></div><div>[original=linear=xxx] -> [snapshot=yyy referring xxx (mounted FS)]<br></div><div><br>Next, user may decide to create new snapshot named zzz of volume yyy in this new mode. After that picture will look like:</div><div><br></div><div>[original=linear=xxx] -> [snapshot=zzz referring xxx] -> [snapshot=yyy referring zzz (mounted FS)]<br></div><div><br></div><div>Note, that having  plenty snapshots in that mode will not affect write performance of yyy. Yes, performance of read operations may slightly suffer </div><div>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).</div><div><br></div><div>Next, this structure allows merging (i.e. zzz into xxx for example) snapshots in chain easily.</div><div><br></div><div>P.S. we may call this operation "split origin" instead of "create snapshot"</div><div><br></div><div>-- <br>Segmentation fault</div></div></div></div>