Change ZFS rpool HDDs to grow

cpzengel

Renowned Member
Nov 12, 2015
221
27
93
Aschaffenburg, Germany
zfs.rocks
Hi Guys,

please have a look at my way to change PVE´s bootable Disks in a Mirror

zpool set autoexpand=on rpool
# Enable Autoexpand on rpool

cfdisk /dev/sdj
# Delete Solaris 8MB Partition, its for saving Space if a replacement drive is minor smaller
cfdisk /def/sdi
# Delete Solaris 8MB Partition

zpool status rpool
# Verify everything is up

zpool offline rpool sdi2
# Check the Drive by Indicator Lamp going offline

zpool online rpool sdi2
# Double Check the Drive by Indicator Lamp going online

zpool status rpool
# Verify if rpool is resilvered

zpool offline rpool sdi2
# Bring Drive to Replace offline again

dmesg -w
#Watch Removal and Inserting the new Drive

sgdisk –backup=table /dev/sdj
sgdisk –load-backup=table /dev/sdi
# Copy Partition Layout to SDI FROM SDJ

cfdisk /dev/sdi
# Verify you did not kill your Partition Table in the last Step

sgdisk -G /dev/sdi
# New Signature to new Drive not to have the Same as the copied Table


update-grub
grub-install /dev/sdi
update-initramfs -u
# Make System bootable


zpool replace rpool sdi2 sdi2
# Replace offline Partition

zpool status rpool 10
Watch Resilver

cfdisk /dev/sdj
# Resize second Partition to maximum
cfdisk /def/sdi
# Resize second Partition to maximum

zpool list
#Verify Succes of Autoexpand
 
Last edited:
  • Like
Reactions: guletz
Thanks for the guide.
It should be noted though that this works if you installed Proxmox VE on ZFS with Grub as bootloader.

Starting in Proxmo VE 6.0 a fresh install could have systemd-boot instead of Grub as bootloader. This will be the case if Proxmox VE is installed with ZFS as file system when booted in UEFI mode.

In that case, the steps will be a bit different. It is described in the documentation in chapter 3.10 Host Bootloader. https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot

The steps after cloning the partition table will be different in that case and are explained in a subchapter to 3.10.3, more precisely in Setting up a new partition for use as synced ESP
 
  • Like
Reactions: guletz

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!