Zpool

From OpenZFS on OS X
Revision as of 00:05, 11 March 2014 by Lundman (Talk | contribs)

Jump to: navigation, search

Creating a pool

In the past, it was customary to label the disk before using it with ZFS. This is no longer the case. It is preferred that ZFS labels the disk.

It is recommended on OS X that ZFS is told to be case-insensitive and using formD. This is what OS X expects by default. It is also recommended to create pools with the default 4096 (4k) disks, even if your disks are still the older 512.

Recommended pool creation command line

zpool create -f -O casesensitivity=insensitive -O normalization=formD -o ashift=12 $poolname /dev/diskX
  • Replace $poolname with the name of the pool you want, for example "tank".
  • If you want to use the entire disk for ZFS, replace /dev/diskX with the available disk. For example /dev/disk1
  • If you have already partitioned the disk, and wish to only use a slice, use /dev/disk1s2

Use "diskutil list" to make sure you pick the correct disk before attempting to create your pool.

You can also decide to disable access time, enable compression and all those nice things. But that can be done at any time in ZFS. For example

zfs set compression=on $poolname


Unplugging a pool

Pool export is not yet automatic in Open ZFS on OS X. Before you unplug any devices should must export all pools used by the device.

zpool export $poolname

The export can sometimes fail if the mount is busy (as with all filesystems). So you might need to close any windows still accessing the ZFS volume. If you are just rebooting, you need not export first.