问题原文
原帖链接 · shivams · CC BY-SA 3.0
I am making zpools on FreeBSD machine. While creating zpools I observe these two cases:
If I take
raw disksand createzpoolthen I am able to form zpools and they are working perfectly.If I format disks using
gpartinfreebsd-zfsformat and then make zpool then also they are working perfectly.
What I am confused in, is which approach is better for creation of zpools?
社区高分解答
原帖链接 · Grogi · CC BY-SA 4.0
Use one slice/partition dedicated for ZFS per physical disc and leave some space unpartitioned. That way if you ever need to replace a drive and the replacement is 10 sectors smaller, you'll still be able to do it (http://www.freebsddiary.org/zfs-with-gpart.php).
That's what Solaris automatically does, that's what FreeNAS does (https://forums.freenas.org/index.php?threads/zfs-on-partitioned-disks.37079/) and that's what ZoL does when you give it a whole disk ( it will partition it)...
The overhead to translate the position on the partition to the position on the actual device is negligible. So once the partition is correctly aligned to the physical sector boundary, there is no reason for it to behave differently than whole block device.
With ZoL, the only difference I am aware are is that ZoL will switch the disk scheduler to noop when whole disk was given to the vdev. Nothing stopping you from setting it manually.
There are some don't though... Don't create more partitions for ZFS per disk and if you decide to ignore the advice above, never ever build vdevs from them in same zpool. This will basically kill the performance, as ZFS will slice the data between the vdevs and sequential iops will turn into seek-nightmare...
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
