Wednesday, August 17, 2022

TrueNAS Scale on Proxmox: Replace disk

Recently, when I logged into the TrueNAS web portal, I saw that my pool was degraded. Apparently, one of the disks has faults, and I decided to replace it (even though the disk is actually quite new, less than a year old).

I basically followed the steps here from the official TrueNAS Scale docs.

However, as the disks are being passed through from Proxmox to a virtual machine, I had to find some way to "remove" the disk being replaced and "install" the new disk.

Luckily, the Proxmox official docs has a guide on how to do this.

In summary:
1. Go to pool status from the TrueNAS GUI, and select "Offline" for the disk being removed.
2. Shut down the TrueNAS VM.
3. In the Proxmox GUI, "detach" the disk from the Hardware list.
4. Use the following command as root in Proxmox to add the new disk to the VM (assuming VM number is 592 and you are adding it as scsi2)
qm set 592 -scsi2 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC
5. Start up the TrueNAS VM.
6. Go to pool status from the TrueNAS GUI, and select "Replace" for the disk being removed/replaced, then choose the newly added disk. Remember to use the "Force" option to force the deletion of all existing data on the new disk.
7. The resilvering process should now start, which can take several days depending on what RAID you are using and the size of the disk.

Note: To get the /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC, the last part (Z1F41BLC) is usually the serial number printed on the disk itself (at least it was for mine). All that I needed to do was
ls /dev/disk/by-id
and look for the corresponding ata-XXXXXXXXXXXX device id.
 
While Proxmox supports the hotplugging of disks, I am not sure if this applies to passed through disks. This is why I shut down the VM before removing and adding the disks.

Now to wait for the resilvering process to complete...

Update 19 August 2022: Got this message eventually with zpool status -v
resilvered 4.73T in 3 days 05:43:58
😊

No comments: