Solved Replacing a drive in a 3-way mirror?

According to a post elsewhere by Phoenix, replacing a drive in a ZFS mirror is simple:

# zpool attach <poolname> <old drive> <new drive>
<wait for resilver to complete>
# zpool detach <poolname> <old drive>


But do I have to pass the drive through GPT first to create the scheme and partition, or will ZFS look at the other 2 discs and do the GPT-ing automagically?
 
You can use whole disks for ZFS, then you don't need any partition table (GPT or MBR).
However, actual and exact disk sizes may vary from vendor to vendor and even disks from the same vendor may have slightly different size from one series or generation to another. Thus, even if the whole disk is used for ZFS, it is wise to create a partition table with a single partition, leaving a few MB of the available disk space unused to account for varying sizes of future replacement disks.

Loosing a few MB on an e.g. 6TB drive won't hurt, but it will save you from serious headaches when ZFS refuses to add your new replacement disk to a vdev because it is a few kb smaller than your dying drives...
If you always replace with bigger disks, you can ignore this, but I'd still strongly recommend using a GPT table. Especially because wisely chosen GPT-Labels for partitions (and using them as identifiers for ZFS) can help you to easily identify and locate failed disks even in huge ZFS-pools.
 
There is another really good reason to use a GPT partition table: You can name the partition with human-readable names. Because "home_copy_2" or "ext_bck_dsk" is more intelligible than "/dev/ada3s4".
 
Agreed that having partitions is better. I made a mistake when setting up the first of the mirrors and used raw discs. I'm planning to fix that as soon as I have some spare time.
 
Back
Top