Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Preparing disks for zpool

Joined
Sep 13, 2019
Messages
36
Thanks
0
#1
I have noticed that when FreeNAS creates a storage pool, it goes through these steps on each disk, wiping the partition table then adding two partitions and bootcode. This adds a significant amount of time if you have many disks, and there is no indication in the GUI of what is happening. Is there some performance benefit to doing this preparation, as opposed to simply running zpool create ?

Code:
gpart create -s gpt /dev/da3
gpart add -a 4k -b 128 -t freebsd-swap -s 4194304 da3
gpart add -a 4k -t freebsd-zfs da3
gpart bootcode -b /boot/pmbr-datadisk /dev/da3
 

pschatz100

FreeNAS Guru
Joined
Mar 30, 2014
Messages
767
Thanks
149
#2
The system is creating two partitions: one for system swap and the other for data. Prepping the disks through the GUI ensures that they will work properly. If you don't do it right at the beginning, there's a good chance you will experience problems down the line.

Why does this bother you?
 
Joined
Sep 13, 2019
Messages
36
Thanks
0
#3
I'm just pointing out that it takes a long time to create a pool, longer than it takes with command line zpool create. Not a big deal, but I'm asking what is the benefit of doing it this way? Why do you need this second partition and the bootcode?
 

anmnz

FreeNAS Guru
Joined
Feb 17, 2018
Messages
217
Thanks
117
#4
It's only a partial answer but: one reason that FreeNAS doesn't simply use the whole disk is because different disks with the same advertised capacity often have slightly different actual capacities. If you are using the whole disk this can mess you up when you try to attach a disk to, or replace a disk in, an existing vdev.
 
Top