How FreeNAS partitions ZFS disks
By default FreeNAS doesn't use whole devices for ZFS vdevs, rather it adds a guid partition table (GPT) with 2G swap slice and the rest for ZFS. The 2G swap size can be defined on the TBD page.
# gpart show da5 => 34 5860533101 da5 GPT (2.7T) 34 94 - free - (47k) 128 4194304 1 freebsd-swap (2.0G) 4194432 5856338696 2 freebsd-zfs (2.7T) 5860533128 7 - free - (3.5k)
If the size of the swap is reduced to zero, then the vdev still created with a GPT but no swap slice. This setting has a strong warning of:
Swap size on each drive in GiB, affects new disks only. Setting this to 0 disables swap creation completely (STRONGLY DISCOURAGED).
# gpart show da5 => 34 5860533101 da5 GPT (2.7T) 34 94 - free - (47k) 128 5860533000 1 freebsd-zfs (2.7T) 5860533128 7 - free - (3.5k)
Thus when the zpool is created the vdev members are on a GPT device. Even if the underlying device names change the member pool names will be constant.
# zpool status pool: dozer state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM dozer ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 gptid/87f5cdf0-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 gptid/89116305-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 gptid/89df42a4-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 gptid/8aab5a83-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 gptid/8b928342-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 gptid/8c630324-1f60-11e4-b4e1-002590c47006 ONLINE 0 0 0 errors: No known data errors
Whereas if the zpool is created with whole devices (Note: the current version of FreeNAS creates a pool with feature com.delphix:hole_birth enabled, which as of August 2014 is not widely supported by other platforms)
# zpool create -m none dozer raidz2 da2 da3 da4 da5 da6 da7
Then the status shows that the vdev is made from whole devices and not GPT slices.
# zpool status pool: dozer state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM dozer ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 da2 ONLINE 0 0 0 da3 ONLINE 0 0 0 da4 ONLINE 0 0 0 da5 ONLINE 0 0 0 da6 ONLINE 0 0 0 da7 ONLINE 0 0 0 errors: No known data errors
Even though the system should not need swap, it is essential to have some swap for crash dumps. Without swap crash issues are not captured and the likelyhood of fixing them reduces.
Questions:
- Why put swap on the member disks?
- Why have swap on non-redundant disks?
- What's the point in having ECC RAM if memory is swapped to non-error checked swap?