ZFS - how to partition SSD for ZIL or L2ARC use?

17,344

Solution 1

It's not a good idea to share an SSD between pools for reasons of data integrity and performance.

First, ZFS needs to be able to trigger the device's onboard cache to flush when a synchronous write is requested, to ensure that the write is really on stable storage before returning to the application. It can only do this if it controls the whole device. If using a slice, ZFS cannot issue the cache flush and you risk losing data during an unexpected shutdown.

Second, the SSD, while very fast, is still a finite resource. Sharing that resource between pools means that the expected performance of the device from either pool's perspective could be vastly different if the drive is busy serving IOPS from the other pool. The end result is that you could have worse performance than if you didn't use the SSD at all.

Dedicated ZIL and L2ARC devices per pool is the way to go.

Solution 2

You don't need to partition the devices. ZFS can use slices, fdisk or GPT partitions but doesn't require any of them. Using the unpartitioned whole device is actually the recommended way when possible.

Solution 3

According to this it should be fairly straightforward. I don't think the partitions themselves matter as much, but your I think disk label needs to be SMI.

Solution 4

I gave up on this and purchased dedicated devices for each application.

Share:
17,344

Related videos on Youtube

ewwhite
Author by

ewwhite

Updated on September 17, 2022

Comments

  • ewwhite
    ewwhite almost 2 years

    I'm working with a Sun x4540 unit with two pools and newly-installed ZIL (OCZ Vertex 2 Pro) and L2ARC (Intel X25-M) devices. Since I need to keep these two pools in the near-term, I'd like to know how to partition these devices to serve both pools of data. I've tried format, parted and fdisk and can't quite seem to get the right combination to generate recognizable partitions for zpool add. The OS in this case is NexentaStor, but I will also need this for general OpenSolaris solutions.

    • jlliagre
      jlliagre over 13 years
      Can you show the commands you used which failed to set the log and cache device ?
    • ewwhite
      ewwhite over 13 years
      I listed them above. Basically, I can't figure out how to properly prepare the partitions.
    • jlliagre
      jlliagre over 13 years
      You indeed listed the commands used but not their parameters and their result. It is hard to precisely answer without a clue about what you tried.
  • jlliagre
    jlliagre over 13 years
    ZFS doesn't requires SMI labels. It can use slices, fdisk partitions, GPT labels or whole unpartitioned disks. If the SSD need to be split, either partition, slices or GPT should work.
  • ewwhite
    ewwhite over 13 years
    I'm trying to use the ZIL device for two pools. As it stands, the ZIL can only be associated with a single pool. Hence the need to partition the drive.
  • jlliagre
    jlliagre over 13 years
    Then just partition it with the tool you prefer, fdisk, gparted, format, GPT, whatever. Any of these will work fine. ZFS doesn't really care.
  • jlliagre
    jlliagre about 13 years
    By curiosity, why did you gave up instead of partitioning the SSD with one of the methods I suggested ?
  • ewwhite
    ewwhite about 13 years
    I could not get any of the partitions or slices to be recognized as valid disks in Nexenta.
  • jlliagre
    jlliagre about 13 years
    What command did you use and what error message did you get ?