ZFS pool change offline disk

Andrea Carnevali

Active Member
Mar 8, 2017
28
0
41
48
Hi.
I should replace a bad disk in a poll zfs raid 1 consisting of 2 disks.
Before intervening as a test, I replicated the problem in the laboratory to verify the correct procedure.




Code:
root@pvetest:~# zpool status -v
  pool: rpool
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
config:

        NAME                                             STATE     READ WRITE CKSUM
        rpool                                            DEGRADED     0     0     0
          mirror-0                                       DEGRADED     0     0     0
            ata-HP_SSD_S700_250GB_HBSA21461100352-part3  ONLINE       0     0     0
            13358101648816339960                         OFFLINE      0     0     0  was /dev/disk/by-id/ata-HP_SSD_S700_250GB_HBSA21461100339-part3

I removed the damaged disk and inserted a new one that matches the working one.
Now I would like to figure out if I need to recreate the partitions before doing the zpool replace.


Code:
 zpool offline rpool 13358101648816339960

If I directly replace the disk then I don't find the same partitioning scheme in the new disk.

Can you help me with the correct command that I should use?

Code:
root@pvetest:~# fdisk -l


Disk /dev/sdb: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: HP SSD S700 250G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4cb97183


Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: HP SSD S700 250G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 22CA1130-F83E-454D-A081-F4F7B72B78C2
Device       Start       End   Sectors   Size Type
/dev/sda1       34      2047      2014  1007K BIOS boot
/dev/sda2     2048   1050623   1048576   512M EFI System
/dev/sda3  1050624 488397134 487346511 232.4G Solaris /usr & Apple ZFS
root@pvetest:~# blkid /dev/sda
/dev/sda: PTUUID="22ca1130-f83e-454d-a081-f4f7b72b78c2" PTTYPE="gpt"
root@pvetest:~# blkid /dev/sdb
/dev/sdb: PTUUID="4cb97183" PTTYPE="dos"

Thanks

Andrea
 
See here the paragraph "Changing a failed bootable device". But that is for PVE 6.4/7.0/7.1 with the new proxmox-boot-tool. For PVE installed with 6.3 and earlier there were other commands. Looks like the wikis versioning isn't helping here because the wiki will be automatically created based on the documentation.
 
Last edited: