ZFS mirror, trying to replace drive

fxandrei

Renowned Member
Jan 10, 2013
163
17
83
So i have 2 drives in a ZFS pool.
1689250331289.png
/dev/sdv is failing and i want to place it.

I dont remember when i made this, but the thing was i was expecting the os to boot if one of the drives was missing.
I was expecting that if sdv is missing, the os will boot from sdw. But it doesnt have a boot partition, so it cant boot right ?

So does anyone have a ideea how i could handle this ?
Could i make sdw as bootable ? That would mean to create a boot partition right ?

Or replace sdv. But how to go about it ?
 
Yes, sdw got no boot partition. You probably added it with "zpool attach" or "zpool replace" without cloning the partition table and syncing the bootloader first, like described in paragraph "Changing a failer bootable device": https://pve.proxmox.com/wiki/ZFS_on_Linux#_zfs_administration

So:
1.) Do your backups
2.) Remove sdw from pool (so single disk pool using sdv)
3.) Follow the steps about cloning the partition table from sdv to sdw and syncing the bootloader from sdv2 to sdw2 (this wipes all data on sdw!)
4) use zfs attach to mirror sdv3 with sdw3

But no idea how well that works when sdv is already failing, as you might just clone damaged data from sdv to sdw, overwriting the healty data of sdw.

So at least do a backup of sdv and sdw using clonezilla or similar.
And I would do a scrub before trying it to see if the pool is already reporting corrupted data(and maybe fixing bqd data on sdv with the healthy data of sdw).
 
Last edited:
So i used detach.
zpool detach rpool ata-ST9500530NS_9SP25SRN

This removed it from the pool, and then wiped sdw.

I then did this:
sgdisk /dev/sdv -R /dev/sdw
zgdisk -G /dev/sdw
zpool replace -f rpool ata-ST9500530NS_9SP264V3-part3 ata-ST9500530NS_9SP25SRN-part3

After it replaced the disk, are re-added part3 of sdv (the failed drive).

Then it says this:

# proxmox-boot-tool format <new disk's ESP>
# proxmox-boot-tool init <new disk's ESP>

What should these ESP whould be ?


Anyway, the both look like this now:
1689283280824.png

So should this boot from the second drive ?
PS: im looking to replace the failed drive but for now all im trying to do is to get this to boot from the new drive.
 
Last edited:
So think its the second partition.
1689315288146.png

But this is what i get when running proxmox-boot-tool status:
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
System currently booted with legacy bios
9AD2-D507 is configured with: uefi (versions: 5.3.18-3-pve, 5.4.106-1-pve, 5.4.73-1-pve), grub (versions: 5.13.19-6-pve, 5.15.108-1-pve, 5.15.83-1-pve)
WARN: /dev/disk/by-uuid/9AD4-1402 does not exist - clean '/etc/kernel/proxmox-boot-uuids'! - skipping

Im not sure what need to be done.
 

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!