Help replacing a Raid1 failed boot drive.

MikeJones

New Member
Nov 30, 2024
2
0
1
I am trying to setup a proxmox with Raid1. I install proxmox with Raid1. After it finishes. I power on the PC with drive (a) removed as a test. System boots no problem. Plug the drive back in remove drive (b). System boots no problem. This tells me the install was done correctly and the is Raid working.

Then I wanted to replace a single drive, to simulate a drive failure. I followed this guide here to update the pool. While this restores the pool, it does not make the drive bootable. I know this because when I remvoed the drive from which information was copied, the system does not boot. There are additional steps I have to take, which I am having trouble with. Someone in the comments of that video said

"If your first nvme fails, your proxmox will not boot anymore, cause you have to copy the 3 partitions (UEFI) from the first nvme to the new one with "sgdisk /dev/nvme0n1 -R /dev/nvme1n1" ... then renew the guid with sgdisk -G /dev/nvme1n1 ... then add the 3rd part.-id to the pool and resilver! ;-)"

There is also this here. Specificly the section on: Changing a failed bootable device.

My problem comes down that I am complerly clueless when it comes to the linux structures / comands.

Code:
# sgdisk <healthy bootable device> -R <new device>
# sgdisk -G <new device>
# zpool replace -f <pool> <old zfs partition> <new zfs partition>

  1. What do I put inside <>
  2. What is health bootable device, that is obviously not c:/ or d:/
  3. What about the partition
I made some screenshots of my setup here.

Would it be like this here

Code:
# sgdisk /dev/sda -R /dev/nvme0n1
# sgdisk -G /dev/nvme0n1
# zpool replace -f zpool /dev/disk/by-id/nvme-eui.0025388981bb209f-part3 <new zfs partition, NOT SURE WHAT TO PUT HERE>
 
This is what I use. Sorry for formatting, I'm on mobile and I just copy pasted my markdown notes.

Remove old device

Code:
zpool offline rpool /dev/disk/by-id/ata-old-disk
Code:
zpool detach rpool /dev/disk/by-id/ata-old-disk

Proxmox boot tool shows an error (this is expected)

Code:
proxmox-boot-tool status

Clean errors

Code:
proxmox-boot-tool clean

Find the device

Code:
ls -l /dev/disk/by-id

Format new disk

If 4K NVMe, then:
https://www.bjonnh.net/article/20210721_nvme4k/

In any case:

Code:
mkfs.ext4 /dev/disk/by-id/ata-new-disk

Initialize GPT

Code:
sgdisk /dev/disk/by-id/ata-new-disk -o

Define the partitions, using 1 sector alignment to get it exact (NOTE: all will have new ID's, as is appropriate)

Code:
sgdisk /dev/disk/by-id/ata-new-disk -a 1 -n 1:34:2047 -t 1:ef02
Code:
sgdisk /dev/disk/by-id/ata-new-disk -a 1 -n 2::1050623 -t 2:ef00
Code:
sgdisk /dev/disk/by-id/ata-new-disk -a 1 -n 3 -t 3:bf01

Verify result

Code:
sgdisk /dev/disk/by-id/ata-new-disk -p

Format and init with Proxmox Boot tool

Code:
proxmox-boot-tool format /dev/disk/by-id/ata-new disk-part2 --force
Code:
proxmox-boot-tool init /dev/disk/by-id/ata-new-disk-part2 --force

Attach the new disk

Code:
zpool attach rpool /dev/disk/by-id/existing-disk-part3 /dev/disk/by-id/ata-new-disk-part3

Refresh boot, just to make sure

Code:
proxmox-boot-tool refresh
 
Last edited:
@enoch85 Thank you for the reply. I am looking at it and comptely lost. But I do see that is vastly different than the wiki. Is this another way? I am starting to think this project is way over my head.