大网数据广告活动
服务器运维问答

Should I create ZFS zpools with whole disks or partitions?

· 52CE 我爱测

I am making zpools on FreeBSD machine. While creating zpools I observe these two cases: If I take raw disks and create zpool then I am able to form zpools and they are working perfectly. If I format disks using gpart in freebsd-z…

问题原文

原帖链接 · shivams · CC BY-SA 3.0

I am making zpools on FreeBSD machine. While creating zpools I observe these two cases:

  1. If I take raw disks and create zpool then I am able to form zpools and they are working perfectly.

  2. If I format disks using gpart in freebsd-zfs format 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...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-09-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。