Preparing disks for zpool

Elliott

Dabbler
Joined
Sep 13, 2019
Messages
40
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

Guru
Joined
Mar 30, 2014
Messages
1,184
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?
 

Elliott

Dabbler
Joined
Sep 13, 2019
Messages
40
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

Patron
Joined
Feb 17, 2018
Messages
286
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