Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

GettingStarted

smuckola edited this page Dec 4, 2011 · 13 revisions
  1. labels Featured

Table of Contents

Getting Started

(note that these instructions assume you've already installed the stable package as found in the downloads section of the mailing list)

Please also see the MacZFS Frequently Asked Questions file! It contains detailed scenarios and explanations for all users, new and advanced.

The underlying storage used by ZFS filesystems involves pools. A pool may consist of one or more whole disks or disk partitions. Basically, these whole disks and/or disk partitions can be combined in several different ways: dynamic striping, mirroring, or RAIDZ.

In all cases, the disks need to use the GUID Partition Table (GPT) and ZFS typically works best when it owns the entire disk due in part to how conservative it is with the write cache.

Create a Simple 1 Disk Pool

In the most simple example, let's start by using a single drive for our "puddle" storage pool. In the following example the commands are issued as root.

First, find out which device node to use with a "diskutil list" command. In the example below, I'm going to work with /dev/disk2 which currently has an APM (Apple Partition Map) label and an exsiting HFS filesystem. I'm going to replace the APM label with a GPT one and blow away the HFS "FW" filesystem. You should unmount any mounted filesystems on the target drive at this point.

Now I'm going to place a GPT label on that disk: *Note this step is very important! You must format the partition before you create a ZFS pool on it*

And create our simple ZFS pool (named "puddle"):

And then check my work, noting that my new ZFS filesystem is available at /Volumes/puddle:

Creating a Mirror or RAIDZ

To create a mirror or a RAIDZ, take a look at the following example where "tank" (a mirrored pair) and "dozer" (a RAIDZ set) are the names of our pools.

Add Storage to a Pool

To add more storage to an existing pool, like "tank"� from the example above, take a look at the following example.

Using an Existing Partition

If you have existing partitions you want to use, so long as the partition map on that drive is GPT and you've unmounted them and understand that pre-existing data on those partitions will be lost, you can use the "diskutil" command to change the label type in place. In the example below, I want to use the pre-existing HFS "blank" and Untitled 2" partitions for my "oddcouple" ZFS mirrored pool. Again, please note that with this example, any previous data on the HFS "blank" and "Untitled 2" partitions will (obviously) be overwritten! Note the Apple_HFS partition type for the "blank"� and "Untitled 2"� partitions:

Change the partition type to ZFS and check your work:

Now create the "oddcouple" pool and check your work:

Other Notes

Manual startup and shutdown

If you created a zpool using any method not explicitly listed above, such as ...

 * a zpool created using an OS other than Mac OS
 * loopback files, as with `mkfile 1g file0 ; zpool create filepool /Users/user/file0`
 * an MBR or APM or any other partition type
 * not using Mac OS's ZFS partition type

... then it will work just fine, but you'll need a manual startup and shutdown procedure as described here.

Spotlight

See the FAQ: Does MacZFS work with Spotlight?

Unless you know exactly what you're doing, you should permanently disable Spotlight on all ZFS filesystems which are listed with `mdutil -vas`. For example: `mdutil -i off /Volumes/mypool`.

Problems

If you have any other problems, be sure that you used a partition like `/dev/disk0s2` and not the whole drive like `/dev/disk0`. And read the FAQ!

Clone this wiki locally