Boot the target system that will receive the ZFS Snapshot.
zpool import -f tank zfs destroy -Rv 'tank@%'
On the source system, create a new snapshot, and send it to the target.
zfs snapshot -r 'tank@p1snap' zfs send -v --props --replicate --large-block --compressed tank@p1snap | ssh root@target 'zfs receive -F tank'
On the target:
zfs set mountpoint=/sysroot tank/root zfs set mountpoint=/sysroot/boot tank/root/boot zfs set mountpoint=/sysroot/tmp tank/root/tmp zfs set mountpoint=/sysroot/var tank/root/var zfs mount -a mount --rbind /dev/ /sysroot/dev/ mount --rbind /proc/ /sysroot/proc/ mount --rbind /sys/ /sysroot/sys/ mount --rbind /run/ /sysroot/run/ chroot /sysroot/ /bin/bash
NOTE: This mounts the freshly received tank, and chroots into it.
Sets the system to do an SELinux relabel:
touch /.autorelabel
Correct the hostname on the target:
echo some_hostname > /etc/hostname
If the system receiving the clone is low spec, add the zfs configuration limiting memory usage:
cp /root/tiny-modprobe.d-zfs.conf /etc/modprobe.d/zfs.conf
dracut --force /boot/initramfs-5.2.9-200.fc30.x86_64.img 5.2.9-200.fc30.x86_64 ZPOOL_VDEV_NAME_PATH=YES grub2-mkconfig > /boot/grub2/grub.cfg sed -i '/^set pager/ s/1/0/' /boot/grub2/grub.cfg
**NOTE: This:
On the target:
Exit the chroot, unmount filesystems, and export tank:
exit umount -l /sysroot/{dev,proc,sys,run}/ zfs set mountpoint=/ tank/root zfs set mountpoint=legacy tank/root/boot zfs set mountpoint=legacy tank/root/tmp zfs set mountpoint=legacy tank/root/var zpool export tank
reboot -f
On the target, remove the snapshot p1snap:
zfs destroy -vr 'tank@p1snap'
On the sender, remove the snapshot p1snap:
zfs destroy -vr 'tank@p1snap'