On Thu, Dec 31, 2020 at 05:08:57PM +0100, john terragon wrote: > On Thu, Dec 31, 2020 at 8:05 AM Andrei Borzenkov wrote: > > > > > > > > > OK, but then could I use Y as parent of the rw snapshot, let's call it > > > W, in a send? > > > > No > > > > Of course I didn't mean to use Y as a parent of W itself but to a > readonly snapshot of W whenever I want to send it to the second FS. > > And I just tried the following steps and they worked: > > 1) created subvol X > 2) created readonly snap Y of X > 3) sent Y to second FS > 4) modified X > 5) created readonly snap X1 of X > 6) sent -p Y X1 to second FS > 7) created readwrite snap Y1 of Y > 8) modified Y1 > 9) created readonly snap Y1_RO of Y1 > 10) sent -p Y Y1_RO to second FS > > So, as you can see, > > -in 6) I've used the RO snap Y of X as the parent of X1 (and X) to > send X1 to the second FS > > -in 10) I did the opposite, Y is still used as the parent but this > time I've sent the RO snap of a subvol that is a snap of Y. > > So it seems to work both ways I think your confusion is that you are thinking of these as a tree. There is no tree, each subvol is an equal peer in the filesystem. "send -p A B" just walks over subvol A and B and sends a diff of the parts of B not in A. You can pick any subvol with -p as long as it's read-only and present on the receiving side. Obviously it's much more efficient if the two subvols have a lot of shared extents (e.g. because B and A were both snapshots made at different times of some other subvol C), but this is not required.