Replacing a disk in a zfs mirror

giovvv

Active Member
Aug 4, 2018
45
0
26
56
I have a proxmox installation with two bootable disks in a ZFS mirror (set up from the Proxmox installer): sda, sdb. I have removed a faulted disk ("zfs detach rpool sdb2") and now I want to replace with a new one.

I understand that I have to use the "zfs attach" command. However, with which device? My pool currently appears like this to "zpool status rpool":

Code:
    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      sda2      ONLINE       0     0     0

My doubt stems from the fact that the zfs filesystem is within a partition. According to fdisk, the working disk is partitioned like this (the faulted disk was also identical):

Code:
Device          Start        End    Sectors  Size Type
/dev/sda1          34       2047       2014 1007K BIOS boot
/dev/sda2        2048 3907012749 3907010702  1.8T Solaris /usr & Apple ZFS
/dev/sda9  3907012750 3907029134      16385    8M Solaris reserved 1

sda1 is the boot partition, sda2 is the zfs partition, and I do not know what sda9 is.

So my questions are:

1. I suppose I must first recreate the same partitioning scheme on the new disk /dev/sdb before attaching sdb2 to the zfs pool. Is that correct?

2. Should I do that manually using fdisk or there is another way?

3. How do I recreate the contents of the boot partition on the new disk? using grub perhaps?

4. What is partition sda9 and what should I do with that on the new disk?

Thanks!
 
Hi,

2. sgdisk is the right way, see wiki proxmox

3. yes it is highly recommended

4. yes, because it is possible that some hdd with the same "capacity" could be differ with few Mb.
So without this 3rd partition you will not be able to add such a disk to your zfs mirror.

good luck / bafta
 

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!