ZFS How to add Hot Swap to zpool?

I'm probably going to get flamed for posting here, but I thought I would try.

This is my zpool:

Code:
# zpool status
  pool: freenas-boot
state: ONLINE
  scan: scrub repaired 0 in 0 days 00:02:35 with 0 errors on Tue Feb  4 03:47:35 2020
config:

    NAME        STATE     READ WRITE CKSUM
    freenas-boot  ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        ada0p2  ONLINE       0     0     0
        ada1p2  ONLINE       0     0     0

errors: No known data errors

  pool: tank
state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
    still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
    the pool may no longer be accessible by software that does not support
    the features. See zpool-features(7) for details.
  scan: scrub repaired 0 in 0 days 05:08:32 with 0 errors on Sun Feb  2 05:08:35 2020
config:

    NAME                                            STATE     READ WRITE CKSUM
    tank                                            ONLINE       0     0     0
      raidz2-0                                      ONLINE       0     0     0
        gptid/2e48e04a-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/2eff3431-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/2fad6079-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/305f9785-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/310fd248-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/31c62952-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/32845d1c-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
        gptid/3338ea10-d2f0-11e6-8e60-0cc47a84a594  ONLINE       0     0     0
    cache
      gptid/3385f967-d2f0-11e6-8e60-0cc47a84a594    ONLINE       0     0     0

errors: No known data errors

Drives are added to the pool by there gptid.

The mappings are as follows:
Code:
# glabel status
                                      Name  Status  Components
gptid/622dd1d9-cdae-11e6-be8a-0cc47a84a594     N/A  ada0p1
gptid/0df883e1-d080-11e6-8e60-0cc47a84a594     N/A  ada1p1
gptid/3385f967-d2f0-11e6-8e60-0cc47a84a594     N/A  ada2p1
gptid/2e48e04a-d2f0-11e6-8e60-0cc47a84a594     N/A  da0p2
gptid/2eff3431-d2f0-11e6-8e60-0cc47a84a594     N/A  da1p2
gptid/2fad6079-d2f0-11e6-8e60-0cc47a84a594     N/A  da2p2
gptid/305f9785-d2f0-11e6-8e60-0cc47a84a594     N/A  da3p2
gptid/310fd248-d2f0-11e6-8e60-0cc47a84a594     N/A  da4p2
gptid/31c62952-d2f0-11e6-8e60-0cc47a84a594     N/A  da5p2
gptid/32845d1c-d2f0-11e6-8e60-0cc47a84a594     N/A  da6p2
gptid/3338ea10-d2f0-11e6-8e60-0cc47a84a594     N/A  da7p2

I have a hotswap drive identified as ada3:
Code:
# camcontrol devlist
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 0 lun 0 (pass0,da0)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 1 lun 0 (pass1,da1)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 2 lun 0 (pass2,da2)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 3 lun 0 (pass3,da3)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 4 lun 0 (pass4,da4)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 5 lun 0 (pass5,da5)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 6 lun 0 (pass6,da6)
<ATA WDC WD60EFRX-68L 0A82>        at scbus0 target 7 lun 0 (pass7,da7)
<SATA SSD S9FM02.1>                at scbus1 target 0 lun 0 (pass8,ada0)
<SATA SSD S9FM02.1>                at scbus2 target 0 lun 0 (pass9,ada1)
<Crucial CT525MX300SSD1 M0CR031>   at scbus5 target 0 lun 0 (pass10,ada2)
<WDC WD60EFRX-68L0BN1 82.00A82>    at scbus6 target 0 lun 0 (ada3,pass11)
<AHCI SGPIO Enclosure 2.00 0001>   at scbus7 target 0 lun 0 (pass12,ses0)

The ada3 drive is not formatted. Do I add it as a hotswap drive to the zpool like:

# zpool add pool spare devices -->> zpool add tank spare ada3

Does the hotswap drive need any fortmatting? Do I need to add by gptid?
Coming from linux backgroud I was always told to reference drives by uuid rather than devID since devIDs can change. I'm not sure however gptID corresponds to UUID however.
 
You are using FreeNAS, so your first stop should be whatever support mechanisms FreeNAS has.

Having said that, read the FreeBSD handbook, section 18.7 explains how disk devices are labeled. Personally, I don't even use gptid (because it is not human readable), instead I give my disk partitions human-readable GPT names using the gpart command. It is also generally considered best practice to use partitions and not whole drives (although that's debatable).

Other than that, your command looks reasonable. Disks or partitions don't need to be formatted before adding them to ZFS.
 
In re the above, assuming ada3 is empty, roughly:
gpart destroy -F ada3
gpart create -s GPT ada3
gpart add -t freebsd-zfs -l ReadableDiskLabel ada3
zpool add tank spare gpt/ReadableDiskLabel
 
Back
Top