[TUTORIAL] Failed Pool Disk in FreeNAS/TrueNAS - Proxmox VM

Dwain

Member
Jul 13, 2018
19
7
23
43
  1. 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.
  2. On FreeNAS VM identify the disk that's bad or needs to be replaced
  3. Record Disk Name and GUID to be used for getting the Serial Number of the disk
  4. Dashboard --> Pool Name --> Data: --> Raid name or DISK --> Disk to be replaced --> GUID
  5. Set the disk to OFFLINE
  6. Storage --> Pools --> Pool name Operations (icon) --> Status
  7. Select Elipsis of the Disk that needs changing and select Offline
  8. Get info on the GPT ID of the OFFLINE disk to be replaced from FreeNAS VM
  9. zpool status |grep OFFLINE
  10. Show the mapping between GPT IDs and device names
  11. glabel status |grep gptid/<ID>
  12. Get the GUID from FreeNAS
  13. Log into FreeNAS web GUI and access the Dashboard
  14. Go to the pool you need to replace the drive in
  15. Select vdevs --> Disk OFFLINE --> OFFLINE --> record the 20 digit GUID#
  16. Get the serial number from Proxmox
  17. sudo blkid |grep <FreeNAS GUID>
  18. Record the Device Name and PARTUUID. PartUUID will be cross-referenced with FreeNAS VM, this should be the same ID as the GPT ID
  19. /dev/sd* and 2f368bbd-...
  20. Search record the serial number of the disk being removed on Proxmox
  21. sudo lshw -class disk -class storage |grep -i -B 6 -A 5 '<FreeNAS Device Name>'
  22. Disable all LXC and KVM from booting on start
  23. Shutdown Promox server and remove or replace the disk based on Serial #
  24. Record the new disk Product, Vendor, and Serial #. You'll need this later for knowing which disk to share in /dev/disk/by-id/
  25. After disk replacement start up the server
  26. Go into Proxmox GUI, select the FreeNAS VM, under Hardware select the Disk Name you removed, and click Detach
  27. Add new disk to FreeNAS VM
  28. Launch a console session on Proxmox
  29. Get the logical name of the device you've added. You might need to install Hardware Lister tool first
  30. 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
  31. Get device "by-id"
  32. ls -al /dev/disk/by-id | grep <serial>
  33. E.g.
  34. lrwxrwxrwx 1 root root 9 Oct 16 11:27 ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK -> ../../sdg

  35. Add the disk to the KVM
  36. qm set <VM-ID> -scsi<increment this number for each disk you add> /dev/disk/by-id/<by-id>
  37. E.g.
  38. qm set 100 -scsi1 /dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK
  39. Validate it's been added (doesn't work for my instance because it has drives hex addresses.
  40. grep <Serial #> /etc/pve/qemu-server/<VM-ID>.conf
  41. E.g.
  42. scsi2: /dev/disk/by-id/ata-WDC_WD80EFAX-68KNBN0_VDJM7YMK
  43. Start the FreeNAS VM and log into the GUI
  44. The pool needs to begin reformatting and resilvering of the new disk
  45. Storage --> Pools --> Pool name Operations (icon) --> Elipsis on the disk that's OFFLINE --> Replace
  46. Select the replacement disk from the drop-down menu then select REPLACE DISK
  47. Click Refresh to update the screen
  48. After the drive replacement process is complete, re-add the replaced disk in the S.M.A.R.T. Tests screen
  49. Tasks --> S.M.A.R.T. Tests --> Elipsis of the existing test --> Drop Down list --> Select new disk --> Save
 
Last edited:
Just wanted to say THANKS! This is my exact situation and I am not super technical so this guide was REALLY helpful :)
 

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!