# Adding new drive as a spare to zpool.



## VC1 (Nov 12, 2018)

I'm new to freebsd. I have inserted a new drive to add as simply a spare to zpool. What is the command to achieve this? Thanks


----------



## bds (Nov 12, 2018)

"zpool add (pool) spare (disk)" should do it.


----------



## VC1 (Nov 12, 2018)

Where would I get the values for "pool" and "disk"?


----------



## ShelLuser (Nov 12, 2018)

VC1 said:


> I'm new to freebsd. I have inserted a new drive to add as simply a spare to zpool. What is the command to achieve this? Thanks


What exactly do you consider a 'spare'? What are you trying to achieve here?

The reason I ask is because spares are only useful when you're using a mirror or a raidz setup. And I would imagine that you'd knew what disks are being used if you set one of those up already.

Alas, can you share the output of `zpool status`? That should provide enough information for this.


----------



## bds (Nov 12, 2018)

"zpool list" will provide a list of pools that your system knows about. There may be multiple ways of identifying your newly-inserted drive, but a combination of checking kernel output ("dmesg") and accounting for existing ones ("zpool status") usually works for me. The /dev/ part of the path to the device node can be omitted.


----------



## VC1 (Nov 12, 2018)

I ejected and re inserted the spare drive and the system ID'd as da7. Thank you for the list command, got the pool name.
It seems to have added it as a spare at the bottom. It is a raidz setup. I am simply trying to add a spare in case one of the drives fails so I can resilver it. 
Anyway I used the zpool add command with the result below. My only question is why are some of the other drive names not da.... but that percentage stuff?


----------



## bds (Nov 13, 2018)

Drives can be located based on how the kernel enumerates them, or by the disk's own identifier. The latter can sometimes be handy when someone sneaks into your data center and randomly swaps all your drives, but is less important for ZFS which can recognise its own components for itself. I don't know why it has been set up with a mix - you can use zpool history to get some clues.


----------



## VC1 (Nov 14, 2018)

Thanks for all your help bds.


----------

