GUIDE Change Disk.

weconnect

Member
May 20, 2020
25
2
8
35
Hello wanted to make a guide on how to change a drive on Proxmox backup server that only has 4 drives and all using rpool as a boot device and pve storage

First take the drive you want to replace offline.
to identify the drive that you want to replace by going into PBS and go to Storage/Tape then ZFS.
look for the drive that you want to replace take it offline.
in my example i want to replace the drive ata-TOSHIBA_HDWQ140_X2MDK61KFAYG (/dev/sdb)

to take the drive offline i do zpool offline rpool /dev/disk/by-id/ata-TOSHIBA_HDWQ140_X2MDK61KFAYG-part3 (part3 is the one you see in pbs or do zpool status)
then replace the drive becouse the server im using dont have hotswappable drives i had to shutdown the server and take out the drive put it back in and then turn the server on.

to idetentify the new drive i took note of the device serial in this case the new drive looks like this ata-ST8000NM017B-2TJ103_WWZ109Q5 to identify the /dev/ do this command

ls -la /dev/disk/by-id/ata-ST8000NM017B-2TJ103_WWZ109Q5
in my case it was /dev/disk/by-id/ata-ST8000NM017B-2TJ103_WWZ109Q5 -> ../../sdb

then we need to copy the partition table from a good known drive.
i picked /dev/sdc.

sgdisk /dev/sdb -R /dev/sdc
then do
sgdisk -G /dev/sdb

after that you just do zpool replace -f rpool /dev/disk/by-id/ata-TOSHIBA_HDWQ140_X2MDK61KFAYG-part3 /dev/disk/by-id/ata-ST8000NM017B-2TJ103_WWZ109Q5-part3
to replace the old drive with the new drive that has the new partition.

wait for the resilvering to be completed check the status via pbs or zpool status -v
after the resilvering is done we now need to copy the boot stuff
proxmox-boot-tool format /dev/sdb2 as that partition is EFI you need to check if this is the EFI partition is /dev/sdb2 via pbs disk list.

proxmox-boot-tool init /dev/sdc2 grub to install grup

then do a proxmox-boot-tool refresh

and proxmox-boot-tool clean to clean up the partition table so that the old drive gets removed.

hope this helps anyone in the future.
 

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!