> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
> boun...@opensolaris.org] On Behalf Of andy thomas
> According to a Sun document called something like 'ZFS best practice' I
> read some time ago, best practice was to use the entire disk for ZFS and
> not to partition or slice it in any way. Does this advice hold good for
> FreeBSD as well?

I'm not going to address the FreeBSD question.  I know others have made some 
comments on the "best practice" on solaris, but here goes:

There are two reasons for the "best practice" of not partitioning.  And I 
disagree with them both.

First, by default, the on-disk write cache is disabled.  But if you use the 
whole disk in a zpool, then zfs enables the cache.  If you partition a disk and 
use it for only zpool's, then you might want to manually enable the cache 
yourself.  This is a fairly straightforward scripting exercise.  You may use 
this if you want:  (No warranty, etc, it will probably destroy your system if 
you don't read and understand and rewrite it yourself before attempting to use 

If you do that, you'll need to re-enable the cache once on each boot (or zfs 

The second reason is because when you "zpool import" it doesn't automatically 
check all the partitions of all the devices - it only scans devices.  So if you 
are forced to move your disks to a new system, you try to import, you get an 
error message, you panic and destroy your disks.  To overcome this problem, you 
just need to be good at remembering the disks were partitioned - Perhaps you 
should make a habit of partitioning *all* of your disks, so you'll *always* 
remember.  On zpool import, you need to specify the partitions to scan for 
zpools.  I believe this is the "zpool import -d" option.

And finally - 

There are at least a couple of solid reasons *in favor* of partitioning.

#1  It seems common, at least to me, that I'll build a server with let's say, 
12 disk slots, and we'll be using 2T disks or something like that.  The OS 
itself only takes like 30G which means if I don't partition, I'm wasting 1.99T 
on each of the first two disks.  As a result, when installing the OS, I always 
partition rpool down to ~80G or 100G, and I will always add the second 
partitions of the first disks to the main data pool.

#2  A long time ago, there was a bug, where you couldn't attach a mirror unless 
the two devices had precisely the same geometry.  That was addressed in a 
bugfix a couple of years ago.  (I had a failed SSD mirror, and Sun shipped me a 
new SSD with a different firmware rev, and the size of the replacement device 
was off by 1 block, so I couldn't replace the failed SSD).  After the bugfix, a 
mirror can be attached if there's a little bit of variation in the sizes of the 
two devices.  But it's not quite enough - As recently as 2 weeks ago, I tried 
to attach two devices that were precisely the same, but couldn't because of the 
different size.  One of them was a local device, and the other was an iscsi 
target.   So I guess iscsi must require a little bit of space, and that was 
enough to make the devices un-mirror-able without partitioning.

zfs-discuss mailing list

Reply via email to