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