On Wed, Jan 16, 2019 at 10:42 AM Georg Sauthoff <mail(a)georg.so> wrote:
On Fri, Jan 04, 2019 at 09:27:33PM +0100, Georg Sauthoff wrote:
> On Sun, Oct 14, 2018 at 04:35:53PM -0600, Chris Murphy wrote:
> > And now it replicates extents from seed to sprout. The copy is faster
> > than pvmove, rsync, dd, or rpm-ostree deploy.
> This sounds great!
> I just tried it (on Fedora 29), but those steps don't work for me:
> # cryptsetup --readonly luksOpen /dev/nbd0p4 tmp
> # mount -o noatime /dev/mapper/tmp /mnt/tmp
> # mount: /mnt/tmp: WARNING: device write-protected, mounted read-only.
> # btrfs device add /dev/nbd1 /mnt/tmp
> Performing full device TRIM /dev/nbd1 (4.00GiB) ...
> ERROR: error adding device '/dev/nbd1': Read-only file system
> Am I missing something?
Ok, a necessary condition for creating a sprout is setting the seed
parameter on the source filesystem (via btrfstune). 
(with the seed parameter a mount of that FS is automatically read-only)
Thus, this works for me:
# cryptsetup luksOpen /dev/nbd0p4 tmp
# btrfstune -S 1/dev/mapper/tmp
# mount -o noatime /dev/mapper/tmp /mnt/tmp
# mount: /mnt/tmp: WARNING: device write-protected, mounted read-only.
# btrfs device add /dev/nbd1 /mnt/tmp
Performing full device TRIM /dev/nbd1 (2.80GiB) ...
# mount -o remount,rw /mnt/tmp
# time btrfs device remove /dev/mapper/tmp /mnt/tmp
# umount /mnt/tmp
Yeah sorry I made the assumption that "the seed" is already flagged
with btrfstune. If it weren't flagged as seed and is rw mounted,
replication does still happen however the first device has its
signature wiped, and the second device inherits the same fs UUID. The
use case here is live migration from one device to another.
In the seed/sprout use case the seed is not wiped (so it can be an
on-going source), and the sprout gets a new fs UUID assigned.