Marks Blog
  • PowerDNS Admin
  • About
  • Simple Ticket System

ZFS Log and Cache on sliced disks

January 31, 2013 by mark

Having two SSD disks in a FreeNAS (w. ZFS) storage system, I wanted to test log and cache. To avoid using 120GB SSD for the log-device (which only needs 1-2GB) I decided to slice the disks, and use the rest for l2arch cache. First, let’s partition the two disks (ad14 + ad15 in my case):

# gpart create -s GPT da14
da14 created
# gpart create -s GPT da15
da15 created

Next, we will slice the two disks with 1 slice for log and 1 slice for cache:

# gpart add -t freebsd-zfs -l log0 -s 2G da14
da14p1 added
# gpart add -t freebsd-zfs -l log1 -s 2G da15
da15p1 added
# gpart add -t freebsd-zfs -l cache0 da14
da14p2 added
# gpart add -t freebsd-zfs -l cache1 da15
da15p2 added

And finaly we can add those to the ZFS pool (zpool0 in my case):

# zpool add zpool0 log /dev/gpt/log*
# zpool add zpool0 cache /dev/gpt/cache*

Running zpool status will show us the newly created log and cache devices:

# zpool status
  pool: zpool0
 state: ONLINE
  scan: none requested
config:

    NAME                                            STATE     READ WRITE CKSUM
    zpool0                                          ONLINE       0     0     0
      raidz2-0                                      ONLINE       0     0     0
        gptid/ad31f70d-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/adc6b13f-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/ae5a9734-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/aef01f30-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/af84e554-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b01b94af-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b0b36854-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b1462c16-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b1e0f4d9-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b272b495-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b30df080-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b3a4ebfd-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
        gptid/b3ede887-6b8e-11e2-9c22-003048d536d4  ONLINE       0     0     0
    logs
      gpt/log0                                      ONLINE       0     0     0
      gpt/log1                                      ONLINE       0     0     0
    cache
      gpt/cache0                                    ONLINE       0     0     0
      gpt/cache1                                    ONLINE       0     0     0

errors: No known data errors
Posted in: Linux & Unix Tagged: cache, freenas, gpart, log, zfs

Weather Station

Pages

  • About
  • PowerDNS Admin
  • Simple Ticket System

Affiliates

  • Danish Sensor Engineering
  • Mintr ApS
  • Nellemann Data

Social

  • BitBucket
  • GitHub
  • LinkedIn
  • Mastodon

Categories

  • Android
  • Automobile
  • Blog & Rantings
  • Development & Scripting
  • Grails
  • Linux & Unix
  • Mac OS X
  • Misc
  • No category
  • PowerDNS Admin
  • Puppet
  • Security Related
  • VirtualBox
  • Virtualization
  • VMware
  • Windows

Archives

  • January 2019
  • September 2017
  • January 2016
  • May 2015
  • March 2015
  • February 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • June 2014
  • January 2014
  • July 2013
  • June 2013
  • February 2013
  • January 2013
  • December 2012
  • August 2012
  • May 2012
  • October 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • March 2010
  • October 2009
  • September 2009
  • April 2009
  • January 2009
  • March 2008
  • January 2008
  • November 2007
  • January 2007
  • December 2006
  • November 2006
  • August 2006
  • June 2006
  • March 2006
  • October 2005
  • August 2005

Copyright © 2025 Marks Blog.

Mobile WordPress Theme by themehall.com