Daily Archives: 2018-02-06

Updating ZFS with new, bigger, disks

Replacing a disk

First prepare the new disk

Clean Up – will fail with a completely new disk

mdadm --zero-superblock --force /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E

More Clean Up

sgdisk --zap-all /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E


sgdisk -a1 -n2:34:2047 -t:EF02 /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E
sgdisk -n1:0:0 -t1:BF01 /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E

See what we’ve now got

fdisk -l

Replace the old ST disk with the new WD disk

zpool attach rpool ata-ST3160023AS_5MT13JAS-part1 /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E-part1

Check it’s OK, resilvering will take place at this point

zpool status

Sort out the boot sector

grub-install /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E

Check to see if the resilver has completed

zpool status

Physically remove the remove the other disk from the system and reboot to check that the boot loader works OK


Assuming it’s all gone well, now resize the pool to onboard the new, bigger, disks

zpool status
zpool online -e tank /dev/disk/by-id/ata-WDC_WD10JFCX-68N6GN0_WD-WXA1AA7DL40E-part1
zpool online -e tank and whatever the other disk is called