Skip to content

Instantly share code, notes, and snippets.

@kmatt
Forked from ianblenke/zil_and_arc.sh
Created June 28, 2018 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmatt/bc1be5978220ed752169a7e609f2b73d to your computer and use it in GitHub Desktop.
Save kmatt/bc1be5978220ed752169a7e609f2b73d to your computer and use it in GitHub Desktop.
FreeBSD ZFS: Putting a ZIL mirror and an L2ARC on only 2 SSD drives
#!/bin/bash
# Based on this blog post: https://clinta.github.io/FreeNAS-Multipurpose-SSD/
set -xe
ssd1=ada2
ssd2=ada3
pool=tank
gpart create -s gpt $ssd1
gpart create -s gpt $ssd2
gpart add -a 4k -b 128 -t freebsd-zfs -s 30G $ssd1
gpart add -a 4k -b 128 -t freebsd-zfs -s 30G $ssd2
gpart add -a 4k -t freebsd-zfs $ssd1
gpart add -a 4k -t freebsd-zfs $ssd2
zil1=$(gpart list $ssd1 | grep rawuuid | head -1 | cut -c13-)
arc1=$(gpart list $ssd1 | grep rawuuid | tail -1 | cut -c13-)
zil2=$(gpart list $ssd2 | grep rawuuid | head -1 | cut -c13-)
arc2=$(gpart list $ssd2 | grep rawuuid | tail -1 | cut -c13-)
zpool add $pool log mirror gptid/$zil1 gptid/$zil2
zpool add $pool cache gptid/$arc1
zpool add $pool cache gptid/$arc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment