Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up boot for clone of existing install on new EFI-enabled hardware #3

Open
GregorKopka opened this issue Mar 20, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@GregorKopka
Copy link

An easier solution to cloning an existing ZFS system to new hardware that boots from EFI: use https://zfsbootmenu.org

Load the EFI image from the website and create a portable installation (https://docs.zfsbootmenu.org/en/latest/guides/general/portable.html) and boot the new machine from it (using an USB stick or through an IPMI console on servers that support it) and you'll end up in the ZFSBootMenu rescue shell which has everything that you need for the rest:

  1. create partitions on the drive(s) as outlined in https://docs.zfsbootmenu.org/en/latest/guides/general/uefi-booting.html and install the ZFSBootMenu .EFI executable as bootloader
  2. create a pool on the remaining space, whatever layout you see fit (you can use all ZFS features supported by the system(s) you want to boot, there is no need to account for the GRUB limitations)
  3. clone the complete rpool from the old machine onto the new pool, eg. over the network (as the ZFSBootMenu runs an LTS linux you should have no big problem setting up a network interface) using zfs send|recv, and also any data (in case you have additional pool(s) on the old machine), copy the kernel and initramfs from the the boot pool of the old system into the /boot directory of your root filesystem dataset
  4. setup the root filesystem as a Boot Environment (https://docs.zfsbootmenu.org/en/latest/guides/general/bootenvs-and-you.html, usually zfs set mountpoint=legacy ROOTFS; zfs set org.zfsbootmenu:active=on /ROOTFS should do that trick)
  5. reboot from local disk, select your boot environment from the menu and enjoy - if needed (which usually is not) use zbm-kcl (https://docs.zfsbootmenu.org/en/latest/man/zbm-kcl.8.html) from the recovery console to adjust kernel parameters.
  6. enjoy

Apart from step 3 the whole process should take less than 5 minutes, in case you want to have an encrypted system then follow https://docs.zfsbootmenu.org/en/latest/guides/general/native-encryption.html instead.

@HankB
Copy link
Owner

HankB commented Mar 20, 2023

Thank you for the detailed information. I will need to dig up a system that uses EFI so I can try this out.

@HankB HankB added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 20, 2023
@GregorKopka
Copy link
Author

IMHO the simplest way to experiment with bootloaders is using a VM (eg. QEMU, in conjunction with Virtual Machine Manager, gives a nice and hazzle-free environment to play with things - without the need to find spare hardware).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants