Editing Zpool

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
Run '''diskutil list''' command to make sure you pick the correct disk before attempting to create your pool. Look under IDENTIFIER. Note that if you partition the disk yourself, and specify a slice for ZFS, you are responsible for making sure the partition table shows the partition type is ZFS. This can be done with OS X's built-in "gpt" command or the easier to use "gdisk" command, which can be downloaded [http://sourceforge.net/projects/gptfdisk/ here]. For detailed instructions, see [[Suppressing_the_annoying_pop-up|here]]. Partitions can also be made by resizing existing ones with '''diskutil'''.
 
  
 
== Creating a pool ==
 
== Creating a pool ==
  
Start using ZFS by first creating a storage pool with the command '''zpool'''. As mentioned above, the disk partition on which the pool will be created must be specified before creation.
+
In the past, you would label (i.e., partition) disks yourself before using them with ZFS. This is no longer the case. Now, in most cases, you will instead want to have ZFS partition disks for you.
 +
 
 +
On OS X you will want to use [http://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms NFD normalization], or quite a few applications won't work (e.g., iTunes).
 +
 
 +
The default for ashift is 9, but you will most likely want to create pools with an ashift of 12, which is appropriate for 4096 (4k) disks (i.e., Advanced Format disks), even if your disks are still the older 512. If you are using SSDs in your pool now, or anticipate replacing any of your pool's disks with SSDs in the future, then an ashift of 13 is a better choice. It is important to get this right now because a vdev's ashift cannot be changed after the vdev is created.
  
Once the disk partition is decided, you may run the following command with a few preferred properties:
 
 
'''Recommended pool creation command line'''
 
'''Recommended pool creation command line'''
  
Line 21: Line 22:
 
* ''If you want to use the entire disk for ZFS'', replace diskX and diskY with the available disks. For example, disk1 and disk2.
 
* ''If you want to use the entire disk for ZFS'', replace diskX and diskY with the available disks. For example, disk1 and disk2.
 
* If you have already partitioned the disk, and wish to only use a slice, use diskXsN. For example, disk1s2.
 
* If you have already partitioned the disk, and wish to only use a slice, use diskXsN. For example, disk1s2.
* -f [https://openzfs.github.io/openzfs-docs/man/8/zpool-create.8.html Forces use of vdevs, '''even if''' they appear '''in use''' or specify a conflicting replication level. Not all devices can be overridden in this manner.] (not: "instructs ZFS to label the disk for you.")
+
* -f instructs ZFS to label the disk for you.
 
* -o ashift=12 instructs ZFS to use 4K sectors, as described here: http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks
 
* -o ashift=12 instructs ZFS to use 4K sectors, as described here: http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks
  
The default for ashift is 9, but you will most likely want to create pools with an ashift of 12, which is appropriate for 4096 (4k) disks (i.e., Advanced Format disks), even if your disks are still the older 512. If you are using SSDs in your pool now, or anticipate replacing any of your pool's disks with SSDs in the future, then an ashift of 13 is a better choice. It is important to get this right now because a vdev's ashift cannot be changed after the vdev is created.
+
Use "diskutil list" to make sure you pick the correct disk before attempting to create your pool. Note that if you partition the disk yourself, and specify a slice for ZFS, you are responsible for making sure the partition table shows the partition type is ZFS. This can be done with OS X's built-in "gpt" command or the easier to use "gdisk" command, which can be downloaded [http://sourceforge.net/projects/gptfdisk/ here]. For detailed instructions, see [[Suppressing_the_annoying_pop-up|here]].
 
+
On OS X you will want to use [http://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms NFD normalization], or quite a few applications won't work (e.g., iTunes). Read [https://towardsdatascience.com/what-on-earth-is-unicode-normalization-56c005c55ad0 What on Earth is Unicode Normalization?] helps understand why.  
+
  
 
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
 
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
Line 62: Line 61:
 
  -O normalization=formD \
 
  -O normalization=formD \
 
  tank mirror disk3 disk4
 
  tank mirror disk3 disk4
 
For available properties to consider and set, see [https://docs.oracle.com/cd/E23824_01/html/821-1448/gazss.html#scrolltoc Introducing ZFS Properties].
 
  
 
== Unplugging a pool ==
 
== Unplugging a pool ==

Please note that all contributions to OpenZFS on OS X may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenZFS on OS X:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)