Solved ZFS with new disks

Hello,

after using a FreeNAS system in our company several years now, I started to playing around at home with FreeBSD with a ZFS-mirror.

But for one thing, I have a question:

creating a pool with a disk, attaching a bigger one to the pool to make a mirror and replacing the first smaler one with also a bigger one and autoexpanded etc.

All this I've done without partition the disk or used gpart.

Would it be better (or neccessary) to partition the disks before with gpart or doesn't it matter if I use the whole disks for ZFS. (I only found examples on the WEB, where gpart is used before...)

Would be nice if you would give me a bit of background about it.

Thanks in advance,
susannej.
 
Thanks a lot!

Because I didn't gpart them, the whole disks are used:

Code:
[susi@obelix ~]$ zpool status Pool-1
  pool: Pool-1
 state: ONLINE
  scan: resilvered 57,5G in 0h7m with 0 errors on Fri Jun  1 17:11:34 2018
config:

    NAME        STATE     READ WRITE CKSUM
    Pool-1      ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        ada2    ONLINE       0     0     0
        ada3    ONLINE       0     0     0

errors: No known data errors

Are there any advantages if I would gpart the disks before?
 
Are there any advantages if I would gpart the disks before?
Most guides always advise that one partition the disk first and preferably using its entire size.

One benefit of going through the process is that you can get to specify what type of fs you want - freebsd-ufs vs freebsd-zfs. One can still carry out zfs/zpool processes on a freebsd-ufs. Perhaps, such a fs gets converted at some point to freebsd-zfs. But I would recommend that one simply specifies the appropriate/preferred fs attributes when preparing the disk for usage.
 
Are there any advantages if I would gpart the disks before?

Rather the other way round[1], but I'd say: if this question arises, then it is completely irrelevant. There are some reasons for doing one or the other (e.g. needing part of the disk for other things), but then you usually know these reasons.

Some discussion also happened here: https://serverfault.com/questions/628632/should-i-create-zfs-zpools-with-whole-disks-or-partitions

[1] There is a saying that if ZFS owns the whole disk, it can use the disk write cache. But I'm not sure if that applies to FreeBSD at all: usually we configure the disk cache via sysctl kern.cam.ada or via camcontrol modepage, and I'd find it strange if ZFS would override that.
 
I recommend partitioning the disks with gpart, even if there is only one large partition on the disk, meaning de-facto the whole disk is used. The reason is that it allows putting a cleartext label on the disk. That can make maintenance easier: /dev/gpt/freds_data_copy_1 is much clearer than /dev/ada3. From a performance or capacity point of view, I don't think it makes a difference (other than loss of a few dozen kilobytes, which is irrelevant).
 
I went with partitioning the disks first, so I could essentially label them to be used in my ZFS pool making them easily identifiable.
 
I went with partitioning the disks first, so I could essentially label them to be used in my ZFS pool making them easily identifiable.
Good on you. You just did as recommended by me and many others. The label is one of the several available attributes.
 
Thanks a lot to all of you!

The label seems one reason that speaks for partitioning.
The downside - for me - would be to have another additional step... But I will read on (I somewhere have the FreeBSD Mastery ZFS...)

In my case I have only 6 SATA Ports, therefore I think I could manage them without the label :) - I'll stick with my configuration.
(2 for zfsroot and currently only 2 hd's for a mirror-pool)

Thanks a lot!
 
Rather the other way round[1], but I'd say: if this question arises, then it is completely irrelevant. There are some reasons for doing one or the other (e.g. needing part of the disk for other things), but then you usually know these reasons.

Some discussion also happened here: https://serverfault.com/questions/628632/should-i-create-zfs-zpools-with-whole-disks-or-partitions

[1] There is a saying that if ZFS owns the whole disk, it can use the disk write cache. But I'm not sure if that applies to FreeBSD at all: usually we configure the disk cache via sysctl kern.cam.ada or via camcontrol modepage, and I'd find it strange if ZFS would override that.

That has never applied to FreeBSD.

The way the disk cache works on Solaris prevents it from being enabled if the disk is partitioned and used with ZFS. However, the way GEOM works on FreeBSD is completely different, and the disk cache is always enabled and usable with ZFS.

It's been almost 5 releases of FreeBSD since it was added. It would be nice if this "advice" died.

FreeBSD can use ZFS on partitioned drives without issues, and without losing performance compared to a non-partitioned drive.
 
Back
Top