Best practice Boot drive ZFS replication

astrakid

Renowned Member
Jun 13, 2013
76
1
73
Hi,
I have installed proxmox on a dell r320 with zfs raid-1.
this seems fine, and i am able to remove a drive and everything works fine. doing further tests it doesn't wo work to simply insert a blank drive and attach it to the zfs pool - boot partition is not synced in this case.

cloning the drive with dd would work but leads into other issues because of duplicated partition-uuid.

my question: is there a best practice how to get a boot partition synced?

my goal: if one drive fails i would like to replace the drive and get it in sync with the other disk to be able to boot from both drives again.

i am quite new to zfs, so please excuse if it sounds stupid.

kind regards,
andre
 
thx a lot!
does that mean if i replace a drive with a new one i have to create the partitions manually and then run pve-efiboot-tool init, or simply run pve-efiboot-tool on the uninitialized disk?

regards,
andre
 
Skimming through the documentation, it looks like you need to partition the disk yourself (with a 512MB 0xEF00 ESP), but pve-efiboot-tool can do the formatting and initialization of the new partition. The tool will also be called automatically when using update-initramfs or system upgrades to keep all your (registered) boot partitions in sync.
 
hey, thanks once again pve-efiboot-tool did it. works great.
now i have one small issue. during my tests with removing and exchanging drives i observed that the devices in the pool are used with sda / sdb3 / ... after failover and rebooting from the "2nd device" of a mirror-0-zpool. can this be changed? i would like to have the uuid or the ids. possible?
kind regards,
andre
 
hey, thanks once again pve-efiboot-tool did it. works great.
now i have one small issue. during my tests with removing and exchanging drives i observed that the devices in the pool are used with sda / sdb3 / ... after failover and rebooting from the "2nd device" of a mirror-0-zpool. can this be changed? i would like to have the uuid or the ids. possible?
kind regards,
andre
Maybe this post or this post can help? Also make sure you use /dev/disk/by-id/... when adding disks. ZFS does not care, but it is more clear which drive is which.
 
and thanks once again! set ZPOOL_IMPORT_PATH in /etc/default/zfs to /dev/disk/by.id and it works as i like!