- I'm posting this as a guide to help anyone who created FreeNAS/TrueNAS VM on Proxmox Host and need to replace or upgrade a failed Disk.
- On FreeNAS VM identify the disk that's bad or needs to be replaced
- Record Disk Name and GUID to be used for getting the Serial Number of the disk
Dashboard --> Pool Name --> Data: --> Raid name or DISK --> Disk to be replaced --> GUID
- Set the disk to OFFLINE
Storage --> Pools --> Pool name Operations (icon) --> Status
- Select Elipsis of the Disk that needs changing and select Offline
- Get info on the GPT ID of the OFFLINE disk to be replaced from FreeNAS VM
zpool status |grep OFFLINE
- Show the mapping between GPT IDs and device names
glabel status |grep gptid/<ID>
- Get the GUID from FreeNAS
- Log into FreeNAS web GUI and access the Dashboard
- Go to the pool you need to replace the drive in
Select vdevs --> Disk OFFLINE --> OFFLINE --> record the 20 digit GUID#
- Get the serial number from Proxmox
sudo blkid |grep <FreeNAS GUID>
- Record the Device Name and PARTUUID. PartUUID will be cross-referenced with FreeNAS VM, this should be the same ID as the GPT ID
/dev/sd* and 2f368bbd-...
- Search record the serial number of the disk being removed on Proxmox
sudo lshw -class disk -class storage |grep -i -B 6 -A 5 '<FreeNAS Device Name>'
- Disable all LXC and KVM from booting on start
- Shutdown Promox server and remove or replace the disk based on Serial #
- Record the new disk Product, Vendor, and Serial #. You'll need this later for knowing which disk to share in /dev/disk/by-id/
- After disk replacement start up the server
- Go into Proxmox GUI, select the FreeNAS VM, under Hardware select the Disk Name you removed, and click Detach
- Add new disk to FreeNAS VM
- Launch a console session on Proxmox
- Get the logical name of the device you've added. You might need to install Hardware Lister tool first
-
Code:
apt-get lshw lshw -class disk -class storage |grep -i -B 6 -A 5 '<serial #>' E.g. description: ATA Disk product: WDC WD80EFAX-68K vendor: Western Digital physical id: 0.6.0 bus info: scsi@0:0.6.0 logical name: /dev/sdg version: 0A81 serial: VDJM7YMK size: 7452GiB (8001GB) capacity: 7452GiB (8001GB) capabilities: 15000rpm gpt-1.00 partitioned partitioned:gpt configuration: ansiversion=6 guid=3f16e878-3381-4e35-81dc-b4b00d9108a0 logicalsectorsize=512 sectorsize=4096
- Get device "by-id"
ls -al /dev/disk/by-id | grep <serial>
- E.g.
- lrwxrwxrwx 1 root root 9 Oct 16 11:27 ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK -> ../../sdg
- Add the disk to the KVM
- qm set <VM-ID> -scsi<increment this number for each disk you add> /dev/disk/by-id/<by-id>
- E.g.
qm set 100 -scsi1 /dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK
- Validate it's been added (doesn't work for my instance because it has drives hex addresses.
grep <Serial #> /etc/pve/qemu-server/<VM-ID>.conf
- E.g.
scsi2: /dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK
- Start the FreeNAS VM and log into the GUI
- The pool needs to begin reformatting and resilvering of the new disk
Storage --> Pools --> Pool name Operations (icon) --> Elipsis on the disk that's OFFLINE --> Replace
- Select the replacement disk from the drop-down menu then select REPLACE DISK
- Click Refresh to update the screen
- After the drive replacement process is complete, re-add the replaced disk in the S.M.A.R.T. Tests screen
Tasks --> S.M.A.R.T. Tests --> Elipsis of the existing test --> Drop Down list --> Select new disk --> Save
Last edited: