Best practice Boot drive ZFS replication

astrakid

Active Member
Jun 13, 2013
72
1
28
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
 

avw

Renowned Member
May 31, 2020
1,025
177
63
my question: is there a best practice how to get a boot partition synced?
Please have a look at pve-efiboot-tool, which is the Proxmox way to keep multiple boot partitions in sync. The documentation also describes how to setup multiple boot partitions (ESP).
 

astrakid

Active Member
Jun 13, 2013
72
1
28
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
 

avw

Renowned Member
May 31, 2020
1,025
177
63
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.
 

astrakid

Active Member
Jun 13, 2013
72
1
28
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
 

avw

Renowned Member
May 31, 2020
1,025
177
63
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.
 

astrakid

Active Member
Jun 13, 2013
72
1
28
and thanks once again! set ZPOOL_IMPORT_PATH in /etc/default/zfs to /dev/disk/by.id and it works as i like!
 

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 your own in 60 seconds.

Buy now!