In case you have a Proxmox hypervisor using zfs raid filesystem and want to replace the disk when disk already reach the wear-out(ssd), or uncorrectable value in smartctl is highly unacceptable or the disk already reach maximum capacity. You can try method below to replace and grow the zfs raid pool without need to make the VM on the server offline.

Step 1
For the zfs pool with already broken disk, the status will be DEGRADED
Check the status of the pool
#zpool status -v
Find out the disk location in your server and prepare the replacement.
The replacement better with the same size and type.
Step 2
You can set the disk to offline using 
#zpool offline pool-name devX
In the degraded pool the broken disk usually already offline.

Step 3
Detach the broken disk and replace with the good one.
Replicate partition table from the good disk to the new disk using sgdisk. Be careful since the format of the command slightly different with another tools. 
#sgdisk -R /dev/new-disk /dev/normal-disk
Re-generate disk uuid since all information on the new disk is replicated from the normal disk.
#sgdisk -G /dev/new-disk

Step 4
Replace the offline/broken disk in the zfs pool.
#zpool replace pool-name /dev/broken-disk /dev/new-disk
Monitor the resilvering/recovery process.
#zpool status -v
* Makesure to adjust the partition based on your disk partition in your pool members.

If your degraded pool is the root(/) partition where the system resides, you need to perform this additional step to update the boot partition in the Grub config.
#dpkg-reconfigure grub-pc
Then make sure to check booth disk.

Hope this help you with your proxmox deployemnt.






IDCloudHost | SSD Cloud Hosting Indonesia
Previous ArticleNext Article

Leave a Reply

Your email address will not be published. Required fields are marked *