Какой подход лучше для ZFS?

205
shivams

Я делаю zpools на машине FreeBSD. При создании zpools я наблюдаю следующие два случая:

  1. Если я возьму raw disksи создаю, zpoolя смогу сформировать zpools, и они работают отлично.

  2. Если диски I формат, используя gpartв freebsd-zfsформате, а затем сделать zpool то и они работают отлично.

Где я запутался - какой подход лучше для создания zpools?

0

2 ответа на вопрос

0
Steve Wills

Use the raw disks when possible, which is everywhere except disks/pool that you're booting the OS from. I think this is the best approach.

0
Kjartan

ZFS uses a different approach to the traditional disk -> partition -> file system concept. As a storage disk handler, it is best used with access to the complete raw disks.

On the other hand, when installing operating systems, some special partitions/slices might be needed. E.g. a swap partition may provide better performance (more 'direct' approach) than a zfs-zvol or a swap file on a zfs volume: swap access would depend on zfs and would have to 'take the long way', which might cause bottle necks in high (io- and memory) load situations.

There are some special cases, for example freeNAS: as a default, it reserves some space for swap on each storage disk, thus it doesn't expose the whole physical disk to zfs. It's a good compromise for 'low key' setups (and I use those, too), but for 'business scenarios' I usually prefer to have a dedicated disk for swap. FreeNAS does have an option to disable default swap creation on newly added disks though, so that's an option. But I'm not sure if it exposes the full physical disk to zfs even then, I think there's some layer added in between (maybe encryption and/or block size correction, haven't looked into that yet).

Generally speaking, you'll probably have many advantages out of using zfs on partitions/slices, but if you're going to use whole disks, don't partition, don't slice, give the raw devices to ZFS and let it do it's magic. ;-)

And don't use any kind of 'hardware RAID' beneath ZFS, except if you know EXACTLY what you're doing. And even then, proceed with all due (and overdue) caution: Here be worse than just dragons...