[SOLVED] Creating a ZFS boot mirror

antplugger

Member
Aug 6, 2022
12
1
8
Hi All,

I have a proxmox server with 2 x Samung 970's. /dev/nvme1n1 is the ZFS boot and I would like to mirror /dev/nvme2n1 for protection.
I have searched but cant seem to find a recipe for the easiest way to do this, expect for fresh install, which I would like to avoid as this node is part of a cluster.

Thanks for any help and suggestions as to how to set up the ZFS boot mirror

config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
nvme1n1p3 ONLINE 0 0 0


1670214186815.png
 
Looks like you already cloned the partition table and wrote the bootloader from nvme1n1 to nvme2n1 like described in "changing a fail bootable device"?
Then you could use the zpool attach command to add nvme2n1p3 to your rpool to form a mirror: https://openzfs.github.io/openzfs-docs/man/8/zpool-attach.8.html
Yes I have, although I got an error running the the following command - Do you think thats an issue. I cant find much about it in the forums. Prior to running the boot tool I tried
# proxmox-boot-tool format /dev/nvme2n1p2
# proxmox-boot-tool init /dev/nvme2n1p2
Which executed fine...

------
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
UUID="F5E2-A58B" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="nvme2n1" MOUNTPOINT=""
Mounting '/dev/nvme2n1p2' on '/var/tmp/espmounts/F5E2-A58B'.
Installing systemd-boot..
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/F5E2-A58B/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/F5E2-A58B/EFI/BOOT/BOOTX64.EFI".
Random seed file /var/tmp/espmounts/F5E2-A58B/loader/random-seed successfully written (512 bytes).
Failed to create EFI Boot variable entry: Invalid argument
 
Yes I have, although I got an error running the the following command - Do you think thats an issue. I cant find much about it in the forums. Prior to running the boot tool I tried
# proxmox-boot-tool format /dev/nvme2n1p2
# proxmox-boot-tool init /dev/nvme2n1p2
Which executed fine...

------
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
UUID="F5E2-A58B" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="nvme2n1" MOUNTPOINT=""
Mounting '/dev/nvme2n1p2' on '/var/tmp/espmounts/F5E2-A58B'.
Installing systemd-boot..
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/F5E2-A58B/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/F5E2-A58B/EFI/BOOT/BOOTX64.EFI".
Random seed file /var/tmp/espmounts/F5E2-A58B/loader/random-seed successfully written (512 bytes).
Failed to create EFI Boot variable entry: Invalid argument
BTW - Sorry, in my haste I forgot to say thanks for replying. I really appreciate your support on this.
Thanks again
 
Solved.
1. Needed to reboot from UFI device.
2. Followed Dunuin's advice with zpool attach.

All good. Thanks
 
Sorry to revive this thread, but I wanted to ask you a question. How do you make sure the two efi partitions stay in sync, specifically in the case of failure of one disk?

I have done the same as you:
Code:
proxmox-boot-tool format /dev/nvme0n1p2
proxmox-boot-tool init /dev/nvme0n1p2
zpool attach rpool nvme1n1p3 /dev/nvme0n1p3
 
Sorry to revive this thread, but I wanted to ask you a question. How do you make sure the two efi partitions stay in sync, specifically in the case of failure of one disk?
Proxmox keeps them in sync by running proxmox-boot-tool (which updates all ESPs that you ran init on) automatically with updates. You might have to setup your motherboard BIOS to boot the other drive (manually) in some failure scenario's.
 
Proxmox keeps them in sync by running proxmox-boot-tool (which updates all ESPs that you ran init on) automatically with updates. You might have to setup your motherboard BIOS to boot the other drive (manually) in some failure scenario's.
That is awesome. Thank you for clarifying for me.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!