my current FreeBSD disk is larger than the two Linux disks,
Then the above method won't work
It's not possible to attach smaller disks to a zpool to form a mirror.
my current FreeBSD disk is larger than the two Linux disks, but the used storage on it does not exceed the capacity of the Linux disks.
The only method in your setup is to install fresh on the two Linux disks (Root-on-ZFS encrypted mirror, choose another pool name, other than "zroot" (i.e. zroot2, zroot-fbsd). Then
- create on the old FreeBSD sytem a recursive snapshot of all descendent datasets (
zfs snap -r zroot@snapname
)
- boot the new system
- import the old system on a alternative mount point:
zpool import -R /mnt zroot
- zfs-send(8) | zfs-receive(8) the snapshot of the old system to the new. That will transfer all applications installed, theire databases, user accounts, theire passwords, system configurations, etc.
- dd(1) the efi and "freebsd-boot" partitions to the second Linux disk of the mirror, those are empty. In case the first disk fails, the other will be able to boot. Make sure "if=" <disk/partition> is the one with the FreeBSD loader.efi, not the empty on the secondary disk.
what you are saying, it's impossible to clone everything to another disk and make it such that it's encrypted BEFORE the OS starts booting? Or, to be more precise, impossible if I want to have zfs RAID-1, correct?
No. You said
it was clearly the case, that those two zfs Linux disks were not GELI-encrypted. Rather, only zsh pools were encrypteed, while the UEFI and boot partitions remained unencrypted.
The UEFI (efi) and "freebsd-boot" partitions can't be encryped (as they aren't on the old FreeBSD disk), otherwise the system can't be booted. That's because the FreeBSD efi loader is on the "efi" partition (on a MSDOS file system). The "freebsd-zfs" (and eventually "freebsd-swap") partition is
geli(8) enabled to boot from a encryped root filesystem, it asks for a passphrase, before the kernel is loaded.
I suggest you practice in a virtual machine, same setup, before carry out on the real system. VirtualBox is good, it`s available on FreeBSD. If you decide to use it, Choose "efi" in the motherboard settings.(8) manual page" href="https://man.freebsd.org/cgi/man.cgi?query=geli[\man] encrypted.
When the system is powered up the UEFI of the motherboard finds the FreeBSD efi loader on the efi partition, let have it to take over to boot the OS. The FreeBSD loader probes all disks and partitions for a kernel to boot, if that kernel resides in a geli encrypted partition, and that partition is
geli(8) enabled to boot from a encryped root filesystem, it asks for a passphrase, before the kernel is loaded.
I suggest you practice in a virtual machine, same setup, before carry out on the real system. VirtualBox is good, it`s available on FreeBSD. If you decide to use it, Choose "efi" in the motherboard settings.&sektion=8&manpath=freebsd-release-ports">geli[\man] encrypted.
When the system is powered up the UEFI of the motherboard finds the FreeBSD efi loader on the efi partition, let have it to take over to boot the OS. The FreeBSD loader probes all disks and partitions for a kernel to boot, if that kernel resides in a geli encrypted partition, and that partition is
geli(8) enabled to boot from a encryped root filesystem, it asks for a passphrase, before the kernel is loaded.
I suggest you practice in a virtual machine, same setup, before carry out on the real system. VirtualBox is good, it`s available on FreeBSD. If you decide to use it, Choose "efi" in the motherboard settings.(8)